Link to home
Start Free TrialLog in
Avatar of Triskelion
TriskelionFlag for United States of America

asked on

Last Possible Cell in Excel

Is there an object or DEFINE or variable that represents the last possible cell in a spreadsheet?

We all know that in Excel 2000, the last cell is IV65536, however, that value (IMHO) should be registered as a constant with the Excel Framework.

I'm looking for something like
   xlLastRangeAddress or
   xlLastCellCoordinate or
   xlLastRow
   xlLastColumn

or even a value that would go in the SpecialCells function

ActiveSheet.Cells.SpecialCells( ...  ).Activate
ASKER CERTIFIED SOLUTION
Avatar of nfernand
nfernand

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Triskelion

ASKER

I guess what I'm asking is more of a version related question.  When the new version comes out or if you're working with an older version, how can you tell what the max number of cells will be?
...other than visibly scrolling or jumping to the bottom-right.
Avatar of gbentley
gbentley

One way I can think of would be a routine that trys the powers of 2 as row and column numbers. The limits are almost always a power  of two. Just keep increasing the row until you get an error (which you trap) then try rows in the same way.

Hope this helps.
Isn't there a hardcoded value that has this reference in it?
NO is also an answer.
I gave you an answer other than NO though!
Yes, I understand.