P Pubis Apr 1, 2004 #1 Is there a built in function in Excel or VBA that will tell you the last used row and the last used column?
Is there a built in function in Excel or VBA that will tell you the last used row and the last used column?
J JE McGimpsey Apr 1, 2004 #2 No. However Dim nLastCol As Long Dim nLastRow As Long With Cells.SpecialCells(xlCellTypeLastCell) nLastRow = .Row nLastCol = .Column End With or Dim nLastCol As Long Dim nLastRow As Long With ActiveSheet.UsedRange nLastRow = .Cells(.Count).Row nLastCol = .Cells(.Count).Column End With come close.
No. However Dim nLastCol As Long Dim nLastRow As Long With Cells.SpecialCells(xlCellTypeLastCell) nLastRow = .Row nLastCol = .Column End With or Dim nLastCol As Long Dim nLastRow As Long With ActiveSheet.UsedRange nLastRow = .Cells(.Count).Row nLastCol = .Cells(.Count).Column End With come close.