That will need VBA, wait a moment, I think somebody will give you help.Thank you for your fast reply.
I only need the number of the last row regardless of the columns and their value types.
Function LastRowColumn(sht As Worksheet, RowColumn AsString) AsLong
'PURPOSE: Function To Return the Last Row Or Column Number In the Active Spreadsheet
'INPUT: "R" or "C" to determine which direction to search
Dim rc AsLong
Select Case LCase(Left(RowColumn, 1)) 'If they put in 'row' or column instead of 'r' or 'c'.
Case "c"
LastRowColumn = sht.Cells.Find("*", LookIn:=xlFormulas, _ SearchOrder:=xlByColumns, SearchDirection:=xlPrevious).Column
Case "r"
LastRowColumn = sht.Cells.Find("*", LookIn:=xlFormulas, SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
Case Else
LastRowColumn = 1
End Select
End Function
Option Explicit
Public Function lLastRow(Optional pvColumn As Variant) As Long
' constants
Const ksADefault = "A"
' declarations
Dim A As String, I As Long
' start
If Not IsMissing(pvColumn) Then
A = CStr(pvColumn)
Else
A = ksADefault
End If
' process
I = Range(A & "1").End(xlDown).End(xlDown).End(xlUp).Row
' end
lLastRow = I
End Function
Vaios
A way to know last line used
I hope I have helped
Decio
Siga
The formula shows the last line used and not how many lines used
Decio
Vaios
A way to know last line used
I hope I have helped
Decio