LASTINCOLUMN

LASTINCOLUMN(rgeInput)
Returns the last cell that contains data in a particular column.

rgeInput

REMARKS
Public Function LASTINCOLUMN( _

Public Function LASTINCOLUMN( _ 
         rngInput As Range) _
         As Variant

Dim WorkRange As Range
Dim i As Integer
Dim CellCount As Integer

   Application.Volatile
   Set WorkRange = rngInput.Columns(1).EntireColumn
   Set WorkRange = Intersect(WorkRange.Parent.UsedRange, WorkRange)
   CellCount = WorkRange.Count
   For i = CellCount To 1 Step -1
       If Not IsEmpty(WorkRange(i)) Then
           LASTINCOLUMN = WorkRange(i).Value
           Exit Function
       End If
   Next i
End Function

For instructions on how to add this function to a workbook refer to the page under Inserting Functions


© 2026 Better Solutions Limited. All Rights Reserved. © 2026 Better Solutions Limited TopPrevNext