Excel - Finding the Last Row, Column or Cell

$SAMPLECODE$

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13

#DEFINE xlA1       1	
#DEFINE xlR1C1     -4150	
#DEFINE xlLastCell 11

* Last Row/Column
lnLastRow = oSheet.UsedRange.Rows.Count
lnLastCol = oSheet.UsedRange.Columns.Count

* Last Cell - Intersection of the last row and the last column
lcLastCell = oSheet.Cells.SpecialCells(xlLastCell).Address(,,xlR1C1)

Comments

Thanks for posting useful tips.