Your InStr arguments are incorrect, swap them (large string, then small string to find within large).
Technically, you can (provided you're just using things like if later, like if balance, and not if balance = VBTrue, which is redudant. (Or would it be if balance Is VBTrue? Anyway.)
You can just do something like this:
balance = InStr(wildcs(3),"x")
Notice the double quotes (single quotes are comments, Im surprised you havent gotten weird errors about that too).
If you DO need to have it be strictly True/False, then you can do this:
balance = (InStr(wildcs(3),"x") <> VBFalse)
I suggest doing the != false, because VBTrue has a numeric value of -1, and the <> will force it to think that that is a comparison, since... well, I dont even want to know what the VBInterpreter might try to do otherwise. Probably nothing. But you definately dont want to deal with True being treated as -1 (any other non-zero evaluates to true though, which is why if youre using balance/etc in purely IF ways, youll be ok. |