Expert Software Company : News

joi, 13 mai 2010

Excel - Finding the Last Row, Column or Cell

#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)

Niciun comentariu:

Trimiteți un comentariu