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 sheeti_col = XL_PlyWorksheet.cells(1, "A").End(xlToRight).Column' Find last filled row in Excel sheeti_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.
Charlie has over a decade of experience in website administration and technology management. As the site admin, he oversees all technical aspects of running a high-traffic online platform, ensuring optimal performance, security, and user experience.























