Roderick_E
Well-known Member
- Joined
- Oct 13, 2007
- Messages
- 2,051
Hi there,
I understand how to do embeded or/and functions in a formula but I guess I don't understand how to do it in a macro.
Example:
If Sheets("AIR SURCHARGE TEST1").Cells(i, 8) = Sheets("SURCHARGES (ACTIVE)").Cells(7, 19).Value OR AND Sheets("SURCHARGES (ACTIVE)").Cells(7, 2).Value ="all" AND Sheets("SURCHARGES (ACTIVE)").Cells(7, 3).Value = "all" AND Sheets("SURCHARGES (ACTIVE)").Cells(7, 4).Value = "all" AND Sheets("SURCHARGES (ACTIVE)").Cells(7, 5).Value = "all"
I'm going to want to build some more OR statements into this I have a 14 senarios. The above is just 2 possible (exact match OR if 4 columns on Surcharges (Active) all equal "all")
the compiler complains about syntax error, do I need ( ) somewhere???
Thanks for the help
I understand how to do embeded or/and functions in a formula but I guess I don't understand how to do it in a macro.
Example:
If Sheets("AIR SURCHARGE TEST1").Cells(i, 8) = Sheets("SURCHARGES (ACTIVE)").Cells(7, 19).Value OR AND Sheets("SURCHARGES (ACTIVE)").Cells(7, 2).Value ="all" AND Sheets("SURCHARGES (ACTIVE)").Cells(7, 3).Value = "all" AND Sheets("SURCHARGES (ACTIVE)").Cells(7, 4).Value = "all" AND Sheets("SURCHARGES (ACTIVE)").Cells(7, 5).Value = "all"
I'm going to want to build some more OR statements into this I have a 14 senarios. The above is just 2 possible (exact match OR if 4 columns on Surcharges (Active) all equal "all")
the compiler complains about syntax error, do I need ( ) somewhere???
Thanks for the help