However, the list font can't be changed, nor can the number of visible rows, which has a maximum of eight. Also, Data Validation doesn't have an AutoComplete feature, which finds matching items in the list as you start to type. To overcome these limitations, you can add a combo box to your worksheet, and use programming to make it appear in cells that contain a data validation list. Click on a cell that contains a data validation list, and the combo box appears. The combo box's font size can be set, more than 8 rows can be displayed, and autocomplete can be enabled. If you would prefer to see the combo box only when you double-click on a data validation cell, please use the instructions at one of the following pages:
Data Validation -- Combo Box Data Validation -- Combo Box - Named Ranges
Note: If the worksheet is protected, allow users to Edit Objects, and they will be able to use the combobox.
Cells C2:C12 have data validation lists with the source K2:K8. When a cell in this range is selected, a dropdown list of weekdays is available. Cells D2:D12 have data validation lists with the source M2:M13. When a cell in this range is selected, a dropdown list of months is available.
the Font property, and click the ... button 2. In the Font dialog box, select a font, font size, and other settings that you want for your combo box.
3. Click OK
Exit Sub errHandler: Resume exitHandler End Sub '==================================== 'Optional code to move to next cell if Tab or Enter are pressed 'from code by Ted Lanham Private Sub TempCombo_KeyDown(ByVal _ KeyCode As MSForms.ReturnInteger, _ ByVal Shift As Integer) Select Case KeyCode Case 9 'Tab ActiveCell.Offset(0, 1).Activate Case 13 'Enter ActiveCell.Offset(1, 0).Activate Case Else 'do nothing End Select End Sub '====================================
To add this code to the worksheet: 1. Right-click on the sheet tab, and choose View Code. 2. Choose Edit | Paste, to paste the code onto the sheet module, where the cursor is flashing. 3. Choose File | Close and Return to Microsoft Excel.
Data Validation - Dependent Dropdowns from a Sorted List Data Validation - Dependent Lists With INDEX Hide Previously Used Items in a Dropdown List Data Validation - Display Messages to the User Data Validation - Display Input Messages in a Text Box Data Validation - Use a List from Another Workbook Data Validation Criteria Examples Data Validation Custom Criteria Examples Data Validation Tips Data Validation Documentation Data Validation Combo Box Data Validation Combo Box - Named Ranges Data Validation Combo Box -- Click Data Validation - Add New Items