Hi I have searched hi and low for an answer to this and would greatly appreciate any sort of assistance.
I have tried the write the below code to open up workbook1, delete the first 18 rows, then open up workbook2, delete the first 19 rows of that and then select the contents of workbook2, copy them, then switch to back to workbook1, find the last empty row and paste.
Problem is my vba opens the 2 workbooks from file paths entered into a separate macro enabled workbook.
So at the moment it looks like this but is breaking when it comes to the first workbook switch:
Workbooks.Open Filename:= _
Range("D6") 'file path stored in D6
Rows("1:18").Select
Range("A18").Activate
Selection.Delete Shift:=xlUp
??? how do I switch to this file???
Workbooks.Open Filename:= _
Range("D11") 'file path stored in D11
Rows("1:18").Select
Range("A19").Activate
Selection.Delete Shift:=xlUp
Rows("1:1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
??? then need to switch back to first file???
'Range("A65536").End(xlup).Offset(1,0)
ActiveSheet.Paste
Many thanks for any advice.
I have tried the write the below code to open up workbook1, delete the first 18 rows, then open up workbook2, delete the first 19 rows of that and then select the contents of workbook2, copy them, then switch to back to workbook1, find the last empty row and paste.
Problem is my vba opens the 2 workbooks from file paths entered into a separate macro enabled workbook.
So at the moment it looks like this but is breaking when it comes to the first workbook switch:
Workbooks.Open Filename:= _
Range("D6") 'file path stored in D6
Rows("1:18").Select
Range("A18").Activate
Selection.Delete Shift:=xlUp
??? how do I switch to this file???
Workbooks.Open Filename:= _
Range("D11") 'file path stored in D11
Rows("1:18").Select
Range("A19").Activate
Selection.Delete Shift:=xlUp
Rows("1:1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
??? then need to switch back to first file???
'Range("A65536").End(xlup).Offset(1,0)
ActiveSheet.Paste
Many thanks for any advice.