Hello all, i have some rows in a sheet in a workbook that i need to use a button assigned to a macro to copy to a sheet in a different workbook. Here is the code i am working with:
Sub CopyRow()
Dim lastrowSrc As Long
Dim lastrowDest As Long
'Get last row of data
lastrowSrc = Sheets("original").Range("A" & Rows.Count).End(xlUp).Row
'Get first blank row (last row of data +1)
lastrowDest = Workbooks("C:\Users\blank\Desktop\summary.xlsx").Worksheets("details").Range("A" & Rows.Count).End(xlUp).Row + 1
'Copy row
Sheets("original").Range("A" & lastrowSrc).EntireRow.Copy Workbooks("C:\Users\blank\Desktop\summary.xlsx").Worksheets("details").Range("A" & lastrowDest)
End Sub
my issue is when i click my button i am getting an error '9' subscript out of range.
any ideas??
Bookmarks