Last cell display

  • Thread starter Thread starter Eddie Equihua
  • Start date Start date
Hi,

Following code will help you.

Regards.


Haldun Alay

Function LastUsedRange(SheetName As String) As String
Application.Volatile True
Dim Wks As Worksheet
On Error Resume Next
Set Wks = Worksheets(SheetName)
If Err.Number <> 0 Then
Err.Clear
LastUsedRange = "Sheet not exist!"
End If
LastUsedRange = Wks.UsedRange.Address(rowabsolute:=False,
columnabsolute:=False)
End Function
 
Also...

For a text-valued column...

=LOOKUP(REPT("z",255),A:A)

would retrieve the last text value from A.

For a numeric column...

=LOOKUP(9.99999999999999E+307,A:A)

would retrieve the last numeric value (number, date, time) from A.
 
Back
Top