Several AND operators inside an IF...

  • Thread starter Thread starter SpeeD
  • Start date Start date
S

SpeeD

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
 
It'll work, its just a syntax error. Try inputting the command as a single
line of code, watching our for erroneous spaces.
 
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
 
Back
Top