Results 1 to 8 of 8

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

Threaded View

  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?
    'Bunch of other code here (Similar to below except using other fonts)
                sTbItem1 = TextBox1.Value
                Select Case sTbItem1
                    Case "."
                        sTbItem1 = Replace(sTbItem1, ".", "ù")
                    Case "1"
                        sTbItem1 = Replace(sTbItem1, "1", "ï")
                    Case "2"
                        sTbItem1 = Replace(sTbItem1, "2", "ð")
                    Case "3"
                        sTbItem1 = Replace(sTbItem1, "3", "ñ")
                    Case "4"
                        sTbItem1 = Replace(sTbItem1, "4", "ò")
                    Case "5"
                        sTbItem1 = Replace(sTbItem1, "5", "ó")
                    Case "6"
                        sTbItem1 = Replace(sTbItem1, "6", "ô")
                    Case "7"
                        sTbItem1 = Replace(sTbItem1, "7", "õ")
                    Case "8"
                        sTbItem1 = Replace(sTbItem1, "8", "ö")
                    Case "9"
                        sTbItem1 = Replace(sTbItem1, "9", "÷")
                    Case "0"
                        sTbItem1 = Replace(sTbItem1, "0", "î")
                End Select
            End If
        End If
        sTolerance = sTbItem1
        TextBox1.Text = sTbItem1
    End If
    Any hints, tips or examples are appreciated.
    Last edited by Rick_Stanich; 09-16-2009 at 12:55 PM.
    Regards

    Rick
    Win10, Office 365

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