Results 1 to 2 of 2

VBA Replace Function with WildCard

This is a discussion on VBA Replace Function with WildCard within the Microsoft Access forums, part of the Question Forums category; I want to use the replace function in VBA to do a wildcard search. Seems like I've been able to ...

  1. #1
    Board Regular giacomo's Avatar
    Join Date
    Feb 2002
    Posts
    1,802

    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.

    example:
    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
    Location
    Carmichael, CA
    Posts
    2,032

    Default

    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.
    Vic

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
  •  


DMCA.com