Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get combobox not to accept user input in Excel-Vba?

Tags:

Does anyone know what the properties are in the combobox that I can manipulate in order not to allow the user to key/type in any data?

like image 586
Vivian Avatar asked Aug 10 '11 06:08

Vivian


People also ask

How do you stop typing in a combo box?

Right click the Combo Box you want to disable typing, then click Properties from the right-clicking menu. See screenshot: 3. In the Properties dialog box, select 2 – fmStyleDropDownList from the Style drop-down list, and then close this dialog box.


2 Answers

Set the the Style of the combobox to 2 - fmStyleDropDownList. This will disallow user input, and will also prevent (combobox).value changes via macro.

like image 161
Jacob Avatar answered Oct 24 '22 15:10

Jacob


YourComboBoxName.Style = fmStyleDropDownList 

or

YourComboBoxName.Style = 2 

(that's from MS Excel Help)

like image 40
Esmu Igors Avatar answered Oct 24 '22 16:10

Esmu Igors