Sub GetLastRow()
Dim rng As Range, lastRow As Long, col As Long
lastRow = Range("A1").End(xlDown).Row //Get last row in column A
col = Range("XFD" & lastRow).End(xlToLeft).Column //Get last used column in last row
Set rng = Range(Cells(lastRow, 1), Cells(lastRow, col))
End Sub