Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Single message box for multiple IF statements
I have three separate IF statemnts. Currently when they
are true, the following code is executed: First IF statement MsgBox "Please enter a Client Name" Cancel = True Second IF statement MsgBox "Please enter a Sub Client" Cancel = True Third IF statement MsgBox "Please enter a File Barcode" Cancel = True This produces three message boxes. Is it possible to have one message box that shows the statements that are true. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Single message box for multiple IF statements
First IF Statement
sText="Please enter a Client Name 2. If Statement sText="Please enter a Sub Client" 3. IF Statement sText="Please enter a File Barcode" msgbox sText Cancel=true -----Original Message----- I have three separate IF statemnts. Currently when they are true, the following code is executed: First IF statement MsgBox "Please enter a Client Name" Cancel = True Second IF statement MsgBox "Please enter a Sub Client" Cancel = True Third IF statement MsgBox "Please enter a File Barcode" Cancel = True This produces three message boxes. Is it possible to have one message box that shows the statements that are true. . |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Single message box for multiple IF statements
Simon,
msg = "" IF 1st is true then msg = "Please enter a Client Name" & (chr10) IF 2nd is true then msg = msg & "Please enter a Sub Client" & (chr10) IF 3rd is true then msg = msg & "Please enter a Sub Client" & (chr10) msgbox msg -----Original Message----- I have three separate IF statemnts. Currently when they are true, the following code is executed: First IF statement MsgBox "Please enter a Client Name" Cancel = True Second IF statement MsgBox "Please enter a Sub Client" Cancel = True Third IF statement MsgBox "Please enter a File Barcode" Cancel = True This produces three message boxes. Is it possible to have one message box that shows the statements that are true. . |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Single message box for multiple IF statements
Dim msg as String
msg = "" If criteria1 then msg = msg & "Please enter a Client Name" & vbcrlf if criteria2 then msg = msg & "Please enter a Sub Client" & vbCrLf if critiera3 then msg = msg & "Please enter a file BarCode" if msg < "" then msgbox msg End if -- Regards, Tom Ogilvy "Simon" wrote in message ... I have three separate IF statemnts. Currently when they are true, the following code is executed: First IF statement MsgBox "Please enter a Client Name" Cancel = True Second IF statement MsgBox "Please enter a Sub Client" Cancel = True Third IF statement MsgBox "Please enter a File Barcode" Cancel = True This produces three message boxes. Is it possible to have one message box that shows the statements that are true. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Single message box for multiple IF statements
this solution worked great.
many thanks. -----Original Message----- Dim msg as String msg = "" If criteria1 then msg = msg & "Please enter a Client Name" & vbcrlf if criteria2 then msg = msg & "Please enter a Sub Client" & vbCrLf if critiera3 then msg = msg & "Please enter a file BarCode" if msg < "" then msgbox msg End if -- Regards, Tom Ogilvy "Simon" wrote in message ... I have three separate IF statemnts. Currently when they are true, the following code is executed: First IF statement MsgBox "Please enter a Client Name" Cancel = True Second IF statement MsgBox "Please enter a Sub Client" Cancel = True Third IF statement MsgBox "Please enter a File Barcode" Cancel = True This produces three message boxes. Is it possible to have one message box that shows the statements that are true. . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Sumproduct, single criteria identified within multiple in single c | Excel Discussion (Misc queries) | |||
Multiple formats in a single cell with multiple formulas | Excel Worksheet Functions | |||
Printing single pages from multiple worksheets in a single print job | Excel Discussion (Misc queries) | |||
Find Multiple instances of Single Criterion in Row & Return To a Single Col | Excel Worksheet Functions | |||
how many if statements can i use in a single cell ? | Excel Worksheet Functions |