Hello, i have a userform with combobox and textboxes and commandbuttons.
I just want to disable the textboxes if user didn't pick a month.
Example: If user try to enter a data in a textboxes without picking a month first, a message will prompt "Please Select a month".
I have a code for this, but when i select the commandbutton or exit the userform without selecting a date, it still prompting the message. I want this for textboxes only.
![]()
Private Sub ComboBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean) If Me.ComboBox1.ListIndex = -1 Then MsgBox "Please select a month", vbExclamation + vbCritical, "Error" Cancel = True Exit Sub End If End Sub
Bookmarks