Hi,
I have two worksheets, worksheet1 = "SalesOrder",
worksheet2 = "Allocation".
Both Worksheets have column headers from A- AC.
I need to copy those data from SalesOrder to add in the list of Allocation at the last row of worksheet 2.
I tried recorded macro with relative reference but it says
"The Information cannot be pasted because the copy area and the paste area are not the same size and shape."
Code for Record Macro
Sub Macro16()
'
' Macro16 Macro
'
'
ActiveCell.Offset(4, 0).Rows("1:1").EntireRow.Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("ShipmentAllocationTij3").Select
Selection.End(xlDown).Select
Selection.End(xlUp).Select
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveSheet.Paste
End Sub
Code Which I tried to Write
Sub Macro()
Dim SO As Worksheet
Dim SA3 As Worksheet
Dim SA4 As Worksheet
Set SO = Sheets("SalesOrder")
Set SA3 = Sheets("ShipmentAllocation3")
Set SA4 = Sheets("ShipmentAllocation4")
For Each ce In SO.Range("A2:A" & SO.Cells(Rows.Count, "A").End(xlUp).Row).SpecialCells(xlCellTypeVisible)
'What is the range I should copy to Add to last row of ShipmentAllocation
ce.EntireRow.Copy Destination:=Worksheets("ShipmentAllocation3).Range()
SATij3LastRow = Worksheets("ShipmentAllocation3").Range("G65536").End(xlUp).Row
Next ce
End Sub()
Bookmarks