Hey,
My code replaces a specific word chosen by the user by another word, also chosen by user. Lets say the words are And & &, and each time there "And", it will be replaced with &.
The problem is that if the word is "and" (Lower Case), it wouldn't recognize it.
How can I overcome this problem? What about the Compare Method?
Edit - totally forgot about LCase()...Code:sWords = Split(sData, vbNewLine) For i = LBound(sWords) To UBound(sWords) - 1 'Retrive text to be replaced sText1 = Left(sWords(i), InStr(1, sWords(i), "=") - 1) If InStr(1, sFilename, sText1) Then 'Replace sText1 with sText2 sText2 = Right(sWords(i), (Len(sWords(i)) - InStr(1, sWords(i), "="))) sFilename = Replace(sFilename, sText1, sText2) End If Next i ConvertWords = sFilename




Reply With Quote