View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
SpeeD SpeeD is offline
external usenet poster
 
Posts: 65
Default Several AND operators inside an IF...

Hi Luke.

The code is this in just one line (the post broke it...)
If Sheets("Original 1").Visible = False And Sheets("Original 2").Visible =
False And Sheets("Original 3 ").Visible = False Then GoTo 1

And it simply doens´t work. When i put tjhe second AND in the code doens´t
run.

SpeeD

"Luke M" wrote:

It'll work, its just a syntax error. Try inputting the command as a single
line of code, watching our for erroneous spaces.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"SpeeD" wrote:

Hi guys.

I have the folowing problem. i need to check 3 conditons inside an IF to
make may macro work. The problem is that it only work with 1 AND not 2 inside
the IF...

Can anyone help me?

This works...
If Sheets("Original 1").Visible = False And Sheets("Original 2").Visible =
False Then GoTo 1

This doesn´t work!!!
If Sheets("Original 1").Visible = False And Sheets("Original 2").Visible =
False And Sheets("Original 3").Visible = False Then GoTo 1