![]() |
how to count the number of occupied columns in a sheet?
I know how to count rows:
lgLastRow = Workbooks(2).Sheets(pbFundSheetNo).Cells(Rows.Coun t, "A").End(xlUp).Row Can the same code be adapted to count the number of used columns? Thanks, Mark |
how to count the number of occupied columns in a sheet?
Hi Mark,
Try: LastCol = Cells(1, Columns.Count).End(xlToLeft).Column --- Regards, Norman "Mark Stephens" wrote in message ... I know how to count rows: lgLastRow = Workbooks(2).Sheets(pbFundSheetNo).Cells(Rows.Coun t, "A").End(xlUp).Row Can the same code be adapted to count the number of used columns? Thanks, Mark |
All times are GMT +1. The time now is 02:21 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com