Hi,
I've got a spreadsheet with several sheets of data, in some of the sheets I would like to copy some of the data across to an excel database.
I know how to record the macro to copy the data needed e.g. stuff in cell's A1 B5 and D3 and get it pasted into the database under cells A1 B1 C1 but what I can’t do is get the macro to write the data to the next line every time the export button is pressed. All it does is over write what’s already there.
The idea is that the user of the spreadsheet enters data then it gets copied to a database for historical purposes
So for example after a week of pressing the export button everyday the database should have 5 lines of data (one for each day)
Hope that makes sense!
Thanks
Example of my code so far....
I've got a spreadsheet with several sheets of data, in some of the sheets I would like to copy some of the data across to an excel database.
I know how to record the macro to copy the data needed e.g. stuff in cell's A1 B5 and D3 and get it pasted into the database under cells A1 B1 C1 but what I can’t do is get the macro to write the data to the next line every time the export button is pressed. All it does is over write what’s already there.
The idea is that the user of the spreadsheet enters data then it gets copied to a database for historical purposes
So for example after a week of pressing the export button everyday the database should have 5 lines of data (one for each day)
Hope that makes sense!
Thanks
Example of my code so far....
Code:
Workbooks.Open Filename:="R:\OperEff\Dave\database.xls"
Windows("Sharedealing CapPlanner V2.xls").Activate
Range("I10").Select
Selection.Copy
Windows("database.xls").Activate
Range("C2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Windows("Sharedealing CapPlanner V2.xls").Activate
Range("I11").Select
Application.CutCopyMode = False
Selection.Copy
Windows("database.xls").Activate
Range("B2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
' The code goes on to copy more items but its alot of code!'