Guanjin Peter
Active Member
- Joined
- May 21, 2008
- Messages
- 429
As you can see the code below, it detects cell B2 if there's a valid date or not. then pops up the msgbox
The problem here is after adding ComboBox1 = ""
the code detects the changes in ComboBox1_Change sub and pops up the msgbox again. I tried to use exit sub and end if, but doesn't stop the msgbox popping up twice. Any way to go around it?
The problem here is after adding ComboBox1 = ""
the code detects the changes in ComboBox1_Change sub and pops up the msgbox again. I tried to use exit sub and end if, but doesn't stop the msgbox popping up twice. Any way to go around it?
Code:
Private Sub ComboBox1_Change()
On Error Resume Next
If IsDate(Range("B2")) = False Then
MsgBox "Please Enter Delivery Date", vbExclamation, "Invalid Date" 'no update until date,cell(b1) is filled
ComboBox1.Value = ""
Else
'Nothing
End Sub