Nov 29, 2007 #1 OhioSteve MIS Mar 12, 2002 1,352 US Here is a vba code fragement: Dim myString as String myString="sdf abc eee abd xqq" replace(myString,"abc","ab") replace(myString,"abd","ab") Can I consolidate the last two commands? I need to know how to use wildcards in vba. I tried "ab?" and that did not work.
Here is a vba code fragement: Dim myString as String myString="sdf abc eee abd xqq" replace(myString,"abc","ab") replace(myString,"abd","ab") Can I consolidate the last two commands? I need to know how to use wildcards in vba. I tried "ab?" and that did not work.
Nov 29, 2007 #2 simian101 MIS Nov 16, 2007 113 US Do we know that there are always going to be 3 characters? I would look at the INSTR function. myString="sdf abc eee abd xqq" ? instr(mystring,"ab") 5 mystring=mid(mystring,1,instr(mystring,"ab")+1)+mid(mystring,instr(mystring,"ab")+3) ? myString sdf ab eee abd xqq of course you would have to set up a loop and check for a second occurance of 'abX' Simi Upvote 0 Downvote
Do we know that there are always going to be 3 characters? I would look at the INSTR function. myString="sdf abc eee abd xqq" ? instr(mystring,"ab") 5 mystring=mid(mystring,1,instr(mystring,"ab")+1)+mid(mystring,instr(mystring,"ab")+3) ? myString sdf ab eee abd xqq of course you would have to set up a loop and check for a second occurance of 'abX' Simi
Dec 1, 2007 #3 PHV MIS Nov 8, 2002 53,708 FR I need to know how to use wildcards in vba http://msdn2.microsoft.com/en-us/library/6wzad2b2.aspx Hope This Helps, PH. FAQ219-2884 FAQ181-2886 Upvote 0 Downvote
I need to know how to use wildcards in vba http://msdn2.microsoft.com/en-us/library/6wzad2b2.aspx Hope This Helps, PH. FAQ219-2884 FAQ181-2886