Results 1 to 2 of 2

Thread: VBA Replace Function with WildCard

  1. #1

    Default VBA Replace Function with WildCard

    I want to use the replace function in VBA to do a wildcard search. Seems like I've been able to do this before but am having the hardest time remembering how.

    x = "test"
    debug.print replace(x,"t*t","hi")

    still prints "test" instead of "hi"

  2. #2
    Board Regular VicRauch's Avatar
    Join Date
    Mar 2006
    Sacramento, CA


    I tried this:

    x = "t*t"
    debug.Print replace(x,"t*t","hi")

    and got "hi" returned. Which looks like it does not accept wildcards. I did not see any wiggle room for wildcards when I read the Help topic. Could it have been something that also incorporated the "Like" keyword?

    Sorry I can't help, but still wanted to encourage you to keep looking. It looks like it will be useful if you find a way to do it.

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts