An implementation of Visual Basic that is built into Microsoft products.
Try removing "(3)".
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I am trying to append two distinct tables with common column names into another table. Below is the code I am using
Sub Button1_Click()
Application.ScreenUpdating = False
Dim copySheet As Worksheet
Dim pasteSheet As Worksheet
Dim LastRow As Long
Set pasteSheet = Worksheets("Sheet3")
'first copy
Set copySheet = Worksheets("Sheet1")
copySheet.Range("table1").Copy Destination:=pasteSheet.Range("table3").End(xlUp).Offset(1)
'move to the next empty row
'LastRow = pasteSheet.Range("table3").End(xlUp).Row
'second copy
Set copySheet = Worksheets("Sheet2")
copySheet.Range("table2").Copy Destination:=pasteSheet(3).Range("table3").End(xlUp).Offset(1)
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub
However, I am getting the error 'Object does not support this property or method' and only contents from table 1 are getting pasted.
An implementation of Visual Basic that is built into Microsoft products.
Answer accepted by question author