H
holt.david1
On a monthly basis, I would like to copy the completed range (varies
from month to month) of a database (Sheet1) to a master list (Sheet3).
Once the data has been copied I intend to manually delete the entries
of Sheet1 and start anew for the new month – for eventual transfer to
Sheet3.
The idea is to copy each month’s data at the bottom of the previous
months’ (Sheet3).
I followed Excel’s record macro command but the macro I ended up with
is not capable of placing the new data at the bottom of the existing
one; it simply keeps overwriting the previous entry.
Unfortunately, I don’t know enough VBA to tweak the code that the
record macro command produced. It appears that the first part,
selecting the non-blank cells and copying into Sheet3 works OK, but I
also would like to copy the new data at the bottom of previous
entries, and the code is not doing it.
Below is the code that I’m struggling with. Any help will be greatly
appreciated.
Dave
Sub DataTransfer()
Range("A2").Select
Range(Selection, Selection.End(xlDown)).Select
Range("A2:A22").Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Sheet3").Select
Range("A1").Select
Selection.End(xlDown).Select
Selection.End(xlUp).Select
Range("A2").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False
End Sub
from month to month) of a database (Sheet1) to a master list (Sheet3).
Once the data has been copied I intend to manually delete the entries
of Sheet1 and start anew for the new month – for eventual transfer to
Sheet3.
The idea is to copy each month’s data at the bottom of the previous
months’ (Sheet3).
I followed Excel’s record macro command but the macro I ended up with
is not capable of placing the new data at the bottom of the existing
one; it simply keeps overwriting the previous entry.
Unfortunately, I don’t know enough VBA to tweak the code that the
record macro command produced. It appears that the first part,
selecting the non-blank cells and copying into Sheet3 works OK, but I
also would like to copy the new data at the bottom of previous
entries, and the code is not doing it.
Below is the code that I’m struggling with. Any help will be greatly
appreciated.
Dave
Sub DataTransfer()
Range("A2").Select
Range(Selection, Selection.End(xlDown)).Select
Range("A2:A22").Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Sheet3").Select
Range("A1").Select
Selection.End(xlDown).Select
Selection.End(xlUp).Select
Range("A2").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False
End Sub