Results 1 to 2 of 2

Thread: How to change data in Excel using VB

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2000
    Posts
    19
    How do i transfer one data from a cell to another but
    retaining the original using VB in Excel and everytime the data changes, a copy of the result will be copied to another place? Thanks for the help.




    God bless
    Nigel
    [email protected]

  2. #2
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Nitro
    Posts
    633

    Can you elaborate more because I am not quite sure. Do you mean VB or VBA?

    Hi Nigel!

    [/b]Here is a start for you in VB.[/b]

    Code:
    Private Sub cmdGetObject1_Click()
      'Reference "Microsoft Excel 9.0 Library"
      Dim xlsWorkBook As Excel.Workbook
      Dim xlsWorkSheet As Excel.Worksheet
      
      Set xlsWorkBook = GetObject("C:\Charts.xls")
      Set xlsWorkSheet = xlsWorkBook.Worksheets("C")
      Text1.Text = xlsWorkSheet.Cells(1, 1).Value
    
     'OR
    
     ' Text1.Text = xlsWorkSheet.Range("A1").Value
      xlsWorkBook.Close
    End Sub
    Chemically Formulated As:
    Dr. Nitro

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width