Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Syntax for multiple if statement
I keep tripping over with the following code. I have tried many variations
of it in my macro and they all fail: If Range("B22") 0 And Range("A35") - Range("B22") = 3 Then Range("A22").Select The code sticks on the first line, so my If statement must be incorrectly written somehow. Any help gratefully received. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Syntax for multiple if statement
On Sat, 3 Dec 2005 14:39:02 -0800, "AndyRoo"
wrote: I keep tripping over with the following code. I have tried many variations of it in my macro and they all fail: If Range("B22") 0 And Range("A35") - Range("B22") = 3 Then Range("A22").Select The code sticks on the first line, so my If statement must be incorrectly written somehow. Any help gratefully received. Sub foo() If Range("B22") 0 And Range("A35") - Range("B22") = 3 Then Range("A22").Select End If End Sub Works fine here. There must be something else going on in your routines that is not apparent from what you've posted. --ron |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Syntax for multiple if statement
OK, thanks. I'll have another look at the rest of my macro.
"Ron Rosenfeld" wrote: On Sat, 3 Dec 2005 14:39:02 -0800, "AndyRoo" wrote: I keep tripping over with the following code. I have tried many variations of it in my macro and they all fail: If Range("B22") 0 And Range("A35") - Range("B22") = 3 Then Range("A22").Select The code sticks on the first line, so my If statement must be incorrectly written somehow. Any help gratefully received. Sub foo() If Range("B22") 0 And Range("A35") - Range("B22") = 3 Then Range("A22").Select End If End Sub Works fine here. There must be something else going on in your routines that is not apparent from what you've posted. --ron |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
IF statement syntax | Excel Discussion (Misc queries) | |||
if statement syntax help | Excel Worksheet Functions | |||
need help with syntax of if statement | Excel Worksheet Functions | |||
when writing an IF statement what is the syntax for "Not Equal to. | Excel Discussion (Misc queries) |