I am trying to combine data from two separate worksheets onto one so it can be sorted for printing. Using the macro recorder, and the search function on the forum, I managed to ham-fist my way through most of it…except for one issue.</SPAN>
How can I have Excel/VBA go to the first open cell in column A before it pastes the 2nd</SPAN> batch of information? I get an "object required" error with the MyRange variable.
How can I have Excel/VBA go to the first open cell in column A before it pastes the 2nd</SPAN> batch of information? I get an "object required" error with the MyRange variable.
Code:
Sub UpdateSortedTab()
Dim MyRange As Variant
' Removes Old Information
Sheets("Sorted").Select
Columns("A:E").Select
Selection.Delete Shift:=xlToLeft
' Copies Bench Stock Information
Sheets("Bench Stock").Select
Range("A2").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Sorted").Select
Range("A2").Select
ActiveSheet.Paste
' Sets Variable
Set MyRange = MyWorkSheet.Range("A2").End(xlDown).Offset(1, 0)
' Copies Work Order Residue
Sheets("Work Order Residue").Select
Range("A2").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Sorted").Select
Range(MyRange).Select
ActiveSheet.Paste
End Sub
Last edited: