View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JE McGimpsey JE McGimpsey is offline
external usenet poster
 
Posts: 4,624
Default Evaluate function

One way:

ddd = Evaluate("expression 1" & _
Iif(IsNumeric(MyVar),MyVar, Chr(34) & MyVar & Chr(34)) & _
"expression 2")

In article
,
avi wrote:

Hello,

In an Evaluate statement I use a variable (MyVar) im the middle of the
function, something like

ddd= Evaluate("expression 1" & MyVar & "expression 2")

When MyVar is not numeric I use

ddd= Evaluate("expression 1" & Chr(34) & MyVar & Chr(34) &
"expression 2")

I look for a way to use one Evaluate statement only , both for numeric
and non numeric ddd instead of 2 statements with IF


Thanks a lot
Avi