Validating combo box

posted by | Leave a comment

Click on a cell that contains a data validation list, and the combo box appears. Value = "" End With End If On Error Go To err Handler If Target. Type = 3 Then 'if the cell contains a data validation list Application.

Then, after you select a number (or date or time) in the combo box drop down list, press the Enter key or the Tab key, to move to the next cell. Activate Case 13 'Enter - change text to number, move down Active Cell. In the premium version, a list box automatically appears when you select a cell that has a drop down list. To send the numbers to the worksheet as real numbers, instead of text, use the following code, instead of the Temp Combo_Key Down code above. It runs on a protected worksheet, and works with most dependent drop down lists. Return Integer, _ By Val Shift As Integer) Select Case Key Code Case 9 'Tab Active Cell. The entry is really text, not a number, so the number formatting does not affect it. Activate Case Else 'do nothing End Select End Sub '==================================== There is a premium version of this technique, and you can see the details here: Data Validation Multi Select Premium. In most cases, these functions and objects duplicate functionality that you can find in other namespaces in the . They are necessary only when the Visual Basic 6.0 code model differs significantly from the . VB6 namespace are provided for use by the tools for upgrading from Visual Basic 6.0 to Visual Basic.

Leave a Reply

Free adult dating profiles without registering