P
Patti
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
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