View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Pops Jackson Pops Jackson is offline
external usenet poster
 
Posts: 64
Default Having "Or" in If statements in VB doesn't work?

I would separate the line as follows:

If a = 2 then
blah blah blah
elseif b = 2 then
blah blah blah
End If

Or, if you want to test for both equalling 2:
If a = 2 then
If b = 2 then
etc.
--
Pops Jackson


"J@Y" wrote:

I was trying this statement:

If a = 2 or b =2 then .....

But the b = 2 doesn't get tested for some reason, why is that?