Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
If statements
The following code will display the message when the calendar is clicked if
any of the textboxes are empty. Change the Or to And if the message is to display only when all the textboxes are empty. Private Sub Calendar1_Click() If TextBox1.Value = "" Or TextBox6.Value = "" Or TextBox7.Value = "" Then MsgBox "Wrong, wrong, wrong!" End If End Sub The same code can be used in the click event of the command button. John Green Sydney "timmulla" wrote in message ... Can anyone help me with IF statements in VB code. I have a form with the following objects: Calendar1 - CalendarControl Commandbutton1 TextBox1 TextBox6 TextBox7 I'm trying to have an error message (or userform) pop up if a user clicks either the calendar1 or the commandbutton1 without having manual inputs in TextBox1, TextBox6, or TextBox7. Can anyone help me with this? Thanks -- Regards, timmulla |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
IF Statements (Mutliple Statements) | Excel Worksheet Functions | |||
if and and statements | Charts and Charting in Excel | |||
If... Then statements | Excel Discussion (Misc queries) | |||
using if statements | Excel Worksheet Functions | |||
operator statements, shorting when reusing one of the statements? | Excel Programming |