Post Reply 
How to determine row/column extent of spreadsheet?
03-08-2016, 01:49 AM
Post: #1
How to determine row/column extent of spreadsheet?
Hi everyone,

For programming purposes, I'm trying to determine how large a given spreadsheet might be. I know that the columns range from A to ZZ, and I believe the number of rows can exceed 10,000. I would like to iterate through the cells of a spreadsheet within the range of populated cells, not within the maximum bounds of the sheet.

What I'd like to determine is the extent of a spreadsheet where you know it is rectangular and populated, i.e., no blank rows or columns or columns of different lengths. I know I can determine the number of rows under these conditions using the code
Code:

L1 := A:A(0);
nrows := length(L1);

How would I determine the number of populated columns? I can't find documentation of any application variable that might be set to the max row or column. Scanning backwards from the ZZ column looking for an non-empty cell also seems pretty unreliable given that a zero is a valid cell content in a spreadsheet interior.

Any thoughts or pointers from anyone?

Thanks as always,
~ Mark

Remember kids, "In a democracy, you get the government you deserve."
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
How to determine row/column extent of spreadsheet? - mfleming - 03-08-2016 01:49 AM



User(s) browsing this thread: 1 Guest(s)