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.
Printable View
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.
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
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.