-
-
Notifications
You must be signed in to change notification settings - Fork 495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Sheet.used_range property #112
Comments
I would have immediate use for a used_range method. Case in point, I deal with spreadsheets that have sparse tabular data. That is, not every cell in the relevant portion of the spreadsheet can be expected to have values in them. As a result, the horizontal and vertical methods are not reliable because they grab the first N cells before hitting a blank cell, then stop. The workaround method I'm doing for this involves looking downward in the first column for an tag (which luckily is present, only because of our own conventions). I can effectively find the last used row in the spreadsheet this way, but it's by far the biggest bottleneck in the code I'm writing. Word of warning: I've accessed the COM object's UsedRange field before in VBA, and I've never felt completely confident it can be trusted. |
There's a good chance it'll be in soon -- in the meantime, you can use the following workaround (assuming you are on Windows): |
Most of these approaches are pretty inefficient. I found an excel formula that computes it - so I'm writing it to an unused cell in Excel and reading back the value. The difference for me was from 12 seconds to less than 0.1 seconds! |
added sheet.used_range, closes #112
No description provided.
The text was updated successfully, but these errors were encountered: