Hi Bruce,
> I tired the code as given. It work fine if my column data is number.
> However, if my column data is Text then it will give a mismatch type
> error.
I do not understand. Show the exact code you are using.
> The code will detect the last cell data instead of the lastrow number.
> Norman, can you help me again ?
> For example my last row cell of the column contain the value "england"
> LastCell = "england"
Try:
'=============>>
Public Sub Tester2()
Dim LastCell As Range
Dim LastRow As Long
Dim LastValue As Variant
Const col As String = "A" '<<==== CHANGE
Set LastCell = Cells(Rows.Count, col).End(xlUp)
LastRow = LastCell.Row
LastValue = LastCell.Value
MsgBox "The last populated cell in column " _
& col & " is " & LastCell.Address(0, 0) _
& vbNewLine & "The corresponding row number is " _
& LastRow & vbNewLine _
& "The cell's value is " & LastValue
End Sub
'<<=============
---
Regards,
Norman
> Hi norman,
> Thank for your help.
[quoted text clipped - 10 lines]
>
> Thank alot