+ Reply to Thread
Results 1 to 8 of 8

A better Case (was "Create Loop with Case statement")

  1. #1
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,179

    A better Case (was "Create Loop with Case statement")

    In the code below I am having trouble creating a loop to check the contents of TextBox1 as it can have upwards of 8 characters. This case statement works fine as long as the character count is one.
    How do I count how many characters are in Textbox1 and then loop thru them? Am I on the right thought track?
    Please Login or Register  to view this content.
    Any hints, tips or examples are appreciated.
    Last edited by Rick_Stanich; 09-16-2009 at 12:55 PM.
    Regards

    Rick
    Win10, Office 365

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Create Loop with Case statement

    Not sure if you need such a loop if you're just replacing characters as you can do a partial match?

  3. #3
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,179

    Re: Create Loop with Case statement

    I dont follow, Partial match?

  4. #4
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Create Loop with Case statement

    With Find and Replace you don't have to match the entire cell contents. Try it from the worksheet and you'll see.

  5. #5
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,179

    Re: Create Loop with Case statement

    Ok, I understand that now.
    I will see how I can apply that in a TextBox.
    Hmm, does it matter if the all of this is in a userform?

  6. #6
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Create Loop with Case statement

    I would have thought it should still work, but what do I know. Report back and put us out of our misery.

  7. #7
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482

    Re: Create Loop with Case statement

    like this perhaps.

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  8. #8
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,179

    Re: Create Loop with Case statement

    Oh sure, now see what you did!?
    Now I have to edit some umpteen pages and condense them to about 1 page.
    Thanks a lot!



    Thanks to all.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1