string checking

  • Thread starter Thread starter Guest
  • Start date Start date
Dim lngLoop As Long
Dim strText As String

strText = "Test string"

For lngLoop = 1 To Len(strText)
Debug.Print "Position " & lngLoop & " is " & Mid$(strText, lngLoop, 1)
Next lngLoop

will result in

Position 1 is T
Position 2 is e
Position 3 is s
Position 4 is t
Position 5 is
Position 6 is s
Position 7 is t
Position 8 is r
Position 9 is i
Position 10 is n
Position 11 is g
 
Perfect. Thats exactly what i want.

Thanks


Douglas J. Steele said:
Dim lngLoop As Long
Dim strText As String

strText = "Test string"

For lngLoop = 1 To Len(strText)
Debug.Print "Position " & lngLoop & " is " & Mid$(strText, lngLoop, 1)
Next lngLoop

will result in

Position 1 is T
Position 2 is e
Position 3 is s
Position 4 is t
Position 5 is
Position 6 is s
Position 7 is t
Position 8 is r
Position 9 is i
Position 10 is n
Position 11 is g
 
Back
Top