Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 65
Default Several AND operators inside an IF...

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,722
Default Several AND operators inside an IF...

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


  #3   Report Post  
Posted to microsoft.public.excel.programming
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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Or and And Operators RyanH Excel Programming 2 August 26th 08 12:57 AM
Operators/if etc Peter[_61_] Excel Programming 4 December 18th 06 11:11 AM
Where are Bitwise Operators Dennis W. Bulgrien Excel Worksheet Functions 1 June 30th 06 05:51 PM
Operators With Times Michael Link Excel Discussion (Misc queries) 2 March 9th 05 02:46 PM
Unary operators Joe Excel Worksheet Functions 3 February 14th 05 06:09 PM


All times are GMT +1. The time now is 02:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"