View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
vello vello is offline
external usenet poster
 
Posts: 4
Default VBA mid() function

Using XP & Excel2002 to find a string in another string, gets me weird results:
Dim S As String
Dim L As Long

S = "0123456789"
For L = 1 To 10
Debug.Print Mid$(S, L, L)
Next

The above code returns the correct value only on the 1st iteration.
Thereafter the Mid$ keeps growing.

Is there an API procedure to accomplish this? Can't seem to find it.