Hello, I am trying to copy range based on number of rows and columns with data, starting with A2
So far I just can copy based on number of rows, but in case if i have more columns, my plan is not working
Can you advice please?
So far I just can copy based on number of rows, but in case if i have more columns, my plan is not working
Can you advice please?
VBA Code:
Sub CopyTemplate()
Dim ws As Worksheet
Dim wk As Workbook
Set wk = Workbooks("XXX")
Set ws = Worksheets("Test")
ws.Activate
With ThisWorkbook.Worksheets("Test")
Dim lr As Long
' Find last row in column A with data
lr = Cells(Rows.Count, "A").End(xlUp).Row
' Copy range
Range("A2:E" & lr).Copy
End With
End Sub