+ Reply to Thread
Results 1 to 3 of 3

Validating values in a userform combox.

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

    Validating values in a userform combox.

    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 Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Validating values in a userform combox.

    Set The combobox Property MatchRequired's value to True.

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

    Re: Validating values in a userform combox.

    Wow I can't believe it was that simple thanks

+ 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