View Single Post
  #20   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Logical String Evaluation

That's fine, but that isn't what you originally asked.

your code does

Evaluate("4=4")

But thanks for clearing it up.


--
Regards,
Tom Ogilvy


"VBA Dabbler" wrote in message
...
Certainly. Try this.

MonthNumber = 4
OperatorString = "="
CriteriaValue = 4
If Evaluate(MonthNumber & OperatorString & CriteriaValue) Then
Msgbox "It Works!"
End If

"Tom Ogilvy" wrote:

How about showing us what works.

--
Regards,
Tom Ogilvy

"VBA Dabbler" wrote in message
...
Thanks for pointing me back to the evaluate method - I had tried it
unsuccessfully and started looking elsewhere.

I did get it to work.

Thanks,
VBA Dabbler

"Mark Bigelow" wrote:

Try:

Application.Evaluate("Month=4")

Mark

VBA Dabbler wrote:
Does anyone know how to evaluate a logical string in VBA? An

example
of one
is:

"Month=4"

If the variable 'Month' is 4, then the string would be true.

Thanks,
VBA Dabbler