Type mismatch
It is not that you assignment of the range value (or text) is wrong you
just need to change your last row code to this......
lstrow = Cells(Rows.Count, "A").End(xlUp).Row
Cheers
Nigel
"Patti" wrote in message
...
Can anyone tell me why this produces Run-time error 13: Type mismatch?
Thanks in advance.
----------
Option Explicit
Private Sub testloop()
Dim lstrow As Long
Dim i As Long
Dim agtname As String
lstrow = Range("a" & Rows.Count).End(xlUp).Rows
For i = 2 To lstrow
agtname = Range("a" & i).Value ' *** also tried .Text & still got
error
MsgBox "Current Name is " & agtname
i = i + 1
Next i
End Sub
|