Results 1 to 3 of 3

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

    Please be a little more specific!

    Hi Nigel!

    [/b]Here is a start for you.[/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

  3. #3

    Thread Starter
    Junior Member
    Join Date
    May 2000
    Posts
    19
    To be more exact,
    For example,

    I have number 25 at (A,26) i want to duplicate it to (B,5)
    and when next time round, (A,26) changes to another number like 39. I want to duplicate it to another place like (B,6)

    How should i go about using VB to manipulate MS Excel. All the numbers or data comes are from another program so its more like when data comes, VB only assist to copy the data to another place for reference. That's all. No fanciful stuff involved.

    Does that help to clear some of your doubts.

    God bless
    Nigel
    [email protected]

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