Results 1 to 2 of 2

Thread: Check Each Letter of Textbox

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2000
    Location
    Davis, CA
    Posts
    23
    How would I be able to run through a text box and look at each letter? I want to be able to keep a loop until it reaches a space or apostophe. Is this even possible?

  2. #2
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Sure, it's easy.

    Code:
        Dim intIndex As Integer
        
        For intIndex = 1 To Len(Text1)
            If Mid$(Text1, intIndex, 1) = " " Or _
               Mid$(Text1, intIndex, 1) = "'" Then
                Exit For
            End If
            Debug.Print Mid$(Text1, intIndex, 1)
        Next

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width