Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to Write a sub to execute the following
If a2="" and c2="New"
Exit Subroutine If a2="" and c2 not equal to the word New then continue executing the subroutine |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to Write a sub to execute the following
Public Sub DoSomething()
If ActiveSheet.Range("A2").Text = "" and ActiveSheet.Range("A2").Text = "New" Then Exit Sub If ActiveSheet.Range("A2").Text = "" and not (ActiveSheet.Range("A2").Text = "New") Then 'Do stuff End if End Sub NOTE: however, 1 1st IF is not necessary because if the 2nd IF is true, the 1st IF must be false 'This is all that is needed to satisfy your critira (unless you intend to do other combination checks, then go with the 1st solution) Public Sub DoSomething() If ActiveSheet.Range("A2").Text = "" and not (ActiveSheet.Range("A2").Text = "New") Then 'Do stuff End if End Sub PS, watch for line breaks in the code samples above; If ...blah...blah.... Then should be on 1 line. "Ronald Cayne" wrote in message ... If a2="" and c2="New" Exit Subroutine If a2="" and c2 not equal to the word New then continue executing the subroutine |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to Write a sub to execute the following
IF Range("A2")= "" then
IF Range("C2")="New" Then Exit Sub Else 'do something else End If End if "Ronald Cayne" wrote: If a2="" and c2="New" Exit Subroutine If a2="" and c2 not equal to the word New then continue executing the subroutine |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to Write a sub to execute the following
Ronald Cayne wrote:
If a2="" and c2="New" Exit Subroutine If a2="" and c2 not equal to the word New then continue executing the subroutine And if a2<""? Alan Beban |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Button to execute Add-in | Excel Discussion (Misc queries) | |||
Five plus mintues to execute | Excel Discussion (Misc queries) | |||
concatenate and then execute? | Excel Worksheet Functions | |||
is it possible to execute write to the fields in another .xsl form a macro in another .xsl? e.g. some way to load another .xsl into an .xsl macro and write to its data? | Excel Worksheet Functions | |||
Could not execute | Excel Worksheet Functions |