WorksheetFunction.Substitute

Joined
Jul 10, 2007
Messages
1
Reaction score
0
Hi All,

I am currently working on some Excel VBA code which performs a Vlookup, however i have hit a snag as some of the values which im looking up contain wildcards (*, ?, ~) which cause the lookup to return incorrect values.

I can resolve this using an excel formula which would look like this:

VLOOKUP(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,"~","~~"),"?","~?"),"*","~*"), A2, OpidReport, 2, False)

However i have no idea how i would incorporate this into VBA code other than it would start application.worksheet.function.substitute

Is anybody able to offer any advise on this?

Thanks,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Substitute 5
Substitute chr(39) 5
Lookup formula problemo 2
VBA userform Vlookup Excel 1
Vlookup 3
Excel VBA 1
Avoiding redundant calculations 7
Excel 2007 formula calculation 3

Back
Top