Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ensure that input matches range of cells

Status
Not open for further replies.

threadgills

Technical User
May 29, 2003
34
0
0
US
I have a validation dropdown list of names in which I need to match the users input to. If the user enters anything besides what is on the list, I need to display an error message.

My validationlist is called =val_list which is on another worksheet (Names) within the workbook.

I can get the data on what the user actually entered if he didn't choose from the dropdown box, but how do I match it up against the list itself?

Thanks
 
Hi [laughtears]

I'm not sure it's what you want but there is a property of your list you can change.
If .style = fmStyleDropDownCombo , the user can write a string which is not in the list.

If .style = fmStyleDropDownList , the user is obliged to choose an item in the list.

I hope it will help you.
Rodie [wavey3]
 
That's exactly what I want...for the user to HAVE to choose an item in the list. I tried putting .style = fmStyleDropDownList but I got an "object doesn't support this property or method" error.

Here's my code:

With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=val_list"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
Selection.Locked = False
Selection.FormulaHidden = False

Any ideas...I thought this would be pretty simple...BUT :)

Thanks!
 
Did you get this to work? I have the same problem with a Listbox. The users are typing in their own descriptions in the return window instead of clicking the dropdown arrow and selecting one from my list.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top