View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Dave R. Dave R. is offline
external usenet poster
 
Posts: 9
Default VBA code for IF statement with OR?

Perfect! Thanks!


"JE McGimpsey" wrote in message
...
One way:

If Var1 = 23 Or Var1 = 34 Then Var = "Hello"

In article ,
"Dave R." wrote:

I would like to know how to do an If statement in VBA which is the

similar
to using OR in excel functions. eg.


I would like to do something like

If Var1 = 23 or 34 then
Var = "Hello"
end if


any help is appreciated, thanks.