Sub test()
MsgBox LatCellUsedInColumn([A1:A100])
MsgBox LatCellUsedInColumn([A1:A100], True)
End Sub
Function LatCellUsedInColumn(ByVal Colonne As Range, Optional IsValued As Boolean = False) As Long
Const ChaineMax As String = "zzzzzzzzzzzzzzzzzzzz"
Const NombreMax As Double = (2 ^ 53 - 1) * 2 ^ 971
If Not Colonne Is Nothing Then
With Application
If Not IsValued Then
LatCellUsedInColumn = .Max(.IfError(.Match(ChaineMax, Colonne.Columns(1), 1), 0), .IfError(.Match(NombreMax, Colonne.Columns(1), 1), 0))
Else
c = Colonne.Address(0, 0)
LatCellUsedInColumn = Evaluate("MAX(ROW(" & c & ")*(" & c & "<>""""))")
End If
End With
End If
End Function