I am trying to find the last row with data in a single column. The result should show row 59, however it shows row 1. I have one blank row in my column, which is row 2.
My code:
The message box answer = 1.Sub LastRow1() Dim sht1 As Worksheet Dim Lr1 As Long Dim rng1 As Range Set sht1 = Worksheets("Contents") With sht1 Lr1 = Cells(Rows.Count, "C").End(xlUp).Row MsgBox Lr1 Set rng1 = sht1.Range("C3:C" & Lr1) End With End sub
I can't see what is wrong?