Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Language: Visual Basic Classic (6 and earlier)
Expertise: Advanced
Jun 16, 2009



Application Security Testing: An Integral Part of DevOps

Get the Last Filled Row or Column in Any Excel Spreadsheet

Sometimes you need to know which is the last row or column in an Excel sheet that contains actual data. To do that, use the following code:

' Find last filled column in Excel sheet
i_col = XL_PlyWorksheet.cells(1, "A").End(xlToRight).Column

' Find last filled row in Excel sheet
i_row = XL_PlyWorksheet.Range("A65536").End(xlUp).Row

Don't forget to add a reference to Excel, or you'll get a compile-time error.

Pavana Shireesha
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date