Hello folks,
Apologies if this is a obvious issue I'm a beginner at VBA.
I have 2 sheets (Data1 & Data2) with tables of information which will vary in size.
I'm trying to write macro that will find the table size on "Data1" and paste it into a new sheet "AllData"
After that it will find the table size on "Data2" and paste it after the "Data1" info on the sheets "AllData".
Ive played about with this code but continually get a Runtime:1004 at the line in red.
Sub copyandpaste()
Sheets("Data1").Cells.Copy Destination:=Sheets("AllData").Range("A1")
Sheets("Data2").Range("A1", Range("A1").End(xlDown)).Copy
Sheets("AllData").Range("A" & Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial Paste:=xlPasteValues
End Sub
Any help would be greatly appreciated.
Kind Regards
Apologies if this is a obvious issue I'm a beginner at VBA.
I have 2 sheets (Data1 & Data2) with tables of information which will vary in size.
I'm trying to write macro that will find the table size on "Data1" and paste it into a new sheet "AllData"
After that it will find the table size on "Data2" and paste it after the "Data1" info on the sheets "AllData".
Ive played about with this code but continually get a Runtime:1004 at the line in red.
Sub copyandpaste()
Sheets("Data1").Cells.Copy Destination:=Sheets("AllData").Range("A1")
Sheets("Data2").Range("A1", Range("A1").End(xlDown)).Copy
Sheets("AllData").Range("A" & Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial Paste:=xlPasteValues
End Sub
Any help would be greatly appreciated.
Kind Regards