+ Reply to Thread
Results 1 to 3 of 3

Validating values in a userform combobox.

  1. #1
    Registered User
    Join Date
    07-05-2013
    Location
    Philadelphia
    MS-Off Ver
    Excel 2013
    Posts
    6

    Validating values in a userform combobox.

    Hello,
    I have successfully made a userform in excel 2010, but I am having issues with the comboboxes . I have populated them with list using the Rowsource function but when using the form you can still type things that aren't included in the list and it accepts it. I have added data validation to the spreadsheet but that the macro overrides it. I also tired the following IF Not statement

    If Not Me.cboPilot.Value = Pilot Then
    MsgBox "Please select a value from Pilot drop down list.", vbExclamation, "New Item"
    Me.cboPilot.SetFocus
    Exit Sub
    End If
    Where Pilot= list of cells (used name manager to accomplish this)

    If anyone has any ideas or can tell me where I went wrong I greatly appreciate it.

    thanks

  2. #2
    Forum Contributor
    Join Date
    05-29-2013
    Location
    MD
    MS-Off Ver
    Excel 365
    Posts
    148

    Re: Validating values in a userform combobox.

    Where are you putting the macro? Is the problem that the validation sub never gets called?

  3. #3
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Validating values in a userform combobox.

    Duplicate post. This has been resolved.
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1