Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
if statement
hi does anybody know why this doesn't work
If IsNull("a6") = True Then MsgBox "Error" Exit Sub End If |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
if statement
Works for me.
The string "a6" isn't Null, so the instructions between Then and End If are skipped. It's also nearly impossible to tell what you mean by "doesn't work". What are you trying to do? In article , "ashw1984" wrote: hi does anybody know why this doesn't work If IsNull("a6") = True Then MsgBox "Error" Exit Sub End If |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
if statement
sorry i want the statement the throw up an error messageand stop the macro,
if a6 is empty if a6 isn't then i would like it to continue with the macro "JE McGimpsey" wrote: Works for me. The string "a6" isn't Null, so the instructions between Then and End If are skipped. It's also nearly impossible to tell what you mean by "doesn't work". What are you trying to do? In article , "ashw1984" wrote: hi does anybody know why this doesn't work If IsNull("a6") = True Then MsgBox "Error" Exit Sub End If |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
if statement
if isempty(worksheets("sheet99").range("a6")) then
or if worksheets("sheet99").range("a6").value = "" then or if trim(worksheets("sheet99").range("a6").value) = "" then Each test different things. The first if there's really nothing (not even a formula) in the cell. The second test if the cell is empty or has a formula that evaluates to "" (like: =if(a11,"","ok") or if it has a zero length text in that cell (like an apostrophe (')). The third does the same thing as the second, but also checks for just space characters, too--like: =if(a11," ","ok") ashw1984 wrote: sorry i want the statement the throw up an error messageand stop the macro, if a6 is empty if a6 isn't then i would like it to continue with the macro "JE McGimpsey" wrote: Works for me. The string "a6" isn't Null, so the instructions between Then and End If are skipped. It's also nearly impossible to tell what you mean by "doesn't work". What are you trying to do? In article , "ashw1984" wrote: hi does anybody know why this doesn't work If IsNull("a6") = True Then MsgBox "Error" Exit Sub End If -- Dave Peterson |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
if statement
One way:
If IsEmpty(Range("A6").Value) Then MsgBox "Error" Exit Sub End If In article , "ashw1984" wrote: sorry i want the statement the throw up an error messageand stop the macro, if a6 is empty if a6 isn't then i would like it to continue with the macro |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
IF statement inside a SUMIF statement.... or alternative method | Excel Worksheet Functions | |||
Reconcile Bank statement & Credit card statement & accounting data | Excel Worksheet Functions | |||
Embedding an OR statement in an IF statement efficiently | Excel Discussion (Misc queries) | |||
appending and IF statement to an existing IF statement | Excel Worksheet Functions | |||
Help please, IF statement/SUMIF statement | Excel Worksheet Functions |