How do i check if a word contains two letters.
VB Code:
Public Sub DoItX(OldLetter As String, OldLetter1 As String, NewLetter As String, NewLetter1 As String) Dim I As Integer Dim NewWord As String For I = 0 To List1.ListCount - 1 [COLOR=Red] If InStr(LCase(List1.List(I)), OldLetter, OldLetter1) Then[/COLOR] NewWord = List1.List(I) NewWord = Replace(LCase(NewWord), OldLetter, NewLetter) NewWord = Replace(LCase(NewWord), OldLetter1, NewLetter1) List2.AddItem NewWord End If Next End Sub
i tried that but it doesn't like the code in red.
Anyone help ?




Reply With Quote