I am trying to make this way of finding the last row as I found the last column:
Sheets(\"Sheet2\").Cells(1,Sheets(\"Sheet2\").Columns.Count).End(xlToLeft).C
How is this?
dim rownum as integer
dim colnum as integer
dim lstrow as integer
dim lstcol as integer
dim r as range
'finds the last row
lastrow = ActiveSheet.UsedRange.Rows.Count
'finds the last column
lastcol = ActiveSheet.UsedRange.Columns.Count
'sets the range
set r = range(cells(rownum,colnum), cells(lstrow,lstcol))