In your code, you're not using the "or" command properly. You have
If TestedLetter = " " TestedLetter = or "'" TestedLetter = or "."
`do stuff to string
endif
It should go...
If TestedLetter = " " or TestedLetter = "=" or Tested Letter = "'" or TestedLetter = "."
`do stuff to string
endif
Quote: "is there a way to instead of doing ! or ' can you test a latter to see if its from a - z "
Yes, there is
Just check the ASCII value of each letter you are using. So change your subroutine to this:
ConvertQuoteToUnderscores:
For x = 1 to len(ChosenQuote)
TestedLetter = Mid$(ChosenQuote, x)
`If letter is a space, then put in a space...
If TestedLetter = " "
UnderscoredQuote=UnderscoredQuote + " "
endif
`Ascii values 65 through 90 are uppercase letters and 97 to 122 are lowercase letters. Any other characters will show up.
if (asc(TestedLetter)>=65 and asc(TestedLetter)<=90) or (asc(TestedLetter)>=97 and asc(TestedLetter)<=122)
UnderscoredQuote=UnderscoredQuote+"_ "
else
UnderscoredQuote = UnderscoredQuote + TestedLetter
endif
next x
return
However, I would recommend putting that into a function that you just pass a string to, and it returns the "underscore" string.
Hope I helped...