tiehaze
asked on
Evaluate Function and Chr(34) in excel vba
This statement below is true, but it is not recognizing it as true. I assume it is because I need to put the Chr(34) somewhere but I do not know where I need to. Can you help me?
If Application.Evaluate(Chr(3 4) & InStr(r.Offset(0, VarA1).Value, VarC1) > 0 & Chr(34)) Then run code a
If Application.Evaluate(Chr(3
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
nevermind, you are correct. thanks
If you have an operator, as in your earlier question, you do not need the Chr(34) at all. This is because you are concatenating several values, and the result is a string. Putting that string inside double quotes then causes an error because the double quotes aren't required.
FYI, you only needed the CHR(34) before because you were comparing text strings ("M"="M" is true, but M=M makes Excel think M is a variable of some kind). Here you are are comparing numbers, so you wouldn't need the CHR(34).
Regards,
Rory
Regards,
Rory
ASKER
The reason I am using evaluate is because I have a variable that is equal to:
=
<>
>
<
and the only way to use those is with evaluate.