I am trying to copy data from one spreadsheet to another (which will already have data in). I need to copy (from source spreadsheet) all populated cells to column B in the destination spreadsheet but at the last row (not overwriting existing data)
here is what I have so far but it is not exactly what I need and is throwing an error saying:
object required
at this line: Last_Row = Range("A" & Rows.Count).End(xlUp).Row)
And I'm trying to do this in a .VBS file
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
Set objWorkbook = objExcel.Workbooks.Open("D:\Test2.xlsx")
Set objWorksheet = objWorkbook.Worksheets("Sheet 2")
Set objRange = objWorksheet.Range("A5:D5")
objRange.Copy
'destination spreadsheet stuff:
Set objExcel2 = CreateObject("Excel.Application")
objExcel2.Visible = True
Set objWorkbook2 = objExcel.Workbooks.Open("D:\Test1.xlsx")
Set objWorksheet2 = objWorkbook2.Worksheets("Sheet1")
Last_Row = Range("A" & Rows.Count).End(xlUp).Row
objWorksheet2.Range("B" & Last_Row).Activate
objWorksheet2.Paste