userform with combobox

ellehcer08

New Member
Joined
Jul 25, 2011
Messages
31
hi! my userform has a combobox, and i would like to create a msgbox that when that combobox is blank or still has the phrase "Select Category..." will create a msgbox stating that the form is incomplete..

this is my code do far:

If cboCategory = "Select Category..." Then
MsgBox "All Fields are Required!"
Else
End If

This code is fine cause when i hit the OK button, the msgbox appears but the information typed in the other txtbox(same userform) is entered in the active sheet. I like to have a code that WILL NOT enter the information stated in other textbox when the OK button is clicked.

Please help!! Thanks a lot...
 
Try something like this.
Code:
If cboCategory = "Select Category..." Then
    MsgBox "All Fields are Required!"
    [COLOR="Red"]Exit Sub[/COLOR]
End If

Otherwise you should list all your code to illustrate how it all interacts.
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top