We help IT Professionals succeed at work.

Invalid Property Value message on manual entry in Excel userform combobox

marrick13
marrick13 asked
on
I have a simple userform that builds a calender on formulas with VBA for several listboxes and a combobox (CmbYear) for selecting the year. The CmbYear combobox allows user entry, but when I enter a value and click the X to close, the Invalid Property Value message appears. It continues until I click the combobox arrow and select one of the years in the list. I shut off the X close function and added a close button, but the error still appears whenever a manual entry is made in the combo box.

I tried a few remedies found online, such as setting the listindex to 0, but that and others didn't work. I have the list max length set to 4 to prevent entry of more than 4 characters, but this doesn't prevent the error.

The file is attached. Help will be greatly appreciated.
Calendar.xlsm
Comment
Watch Question

Martin LissSocial distance - Don't touch your face - Wash your hands for 20 seconds
CERTIFIED EXPERT
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
Can you give step by step instructions on how to reproduce the problem?
CERTIFIED EXPERT
Top Expert 2008

Commented:
Set the MatchRequired property to False for the Year combo box.

Kevin

Author

Commented:
Click the CmbYear combobox and enter a year. You can either select the existing year and remove it or delete any of the year's digits and replace them. Then click CLOSE to get the message. In other words, the error occurs every time you manually change a year and click close. To clear the error, just select any year from the CmBYear box.

Try it with the newly attached - the previous file had year validation code that I thought I had removed.
CERTIFIED EXPERT
Top Expert 2008
Commented:
The problem is that the MatchRequired property is set to True and when you leave the control by clicking on another control, Excel is complaining that the entered value is not a match out of the drop down list.

Kevin