|
Answer» Hello. I have a little problem with VBA (in Excel 2003)
I WANDERED what is the code to lock down a combo box on a combo box in excel. All I want to do is lock is so that people cannot alter the text already in the combo box, but still be able to use it. I have tried combobox1.lock but so far no luck...and I cannot find anything in the properties that will do this. (bear in mind it is taken from the control toolbox not the form toolbox).
Any help would be appreciated, thanks.
BUMP
Can you help please?I was unable to find whether the .locked property had been dropped for Excel 2003 combo boxes. If you can't find it on the property SHEET, you may be able to define a range object for the cells the combo box covers. The range object should have a .locked property.
Double check that there are no overlaps or INTERSECTS with other controls you may have defined.
Good luck. There is a .locked because when ENTER "." it gives me an option of possible choice. And the combo box is not covering any cells it is over the spreadsheet, as they are the same as VB controls...Quote All I want to do is lock is so that people cannot alter the text already in the combo box, but still be able to use it.
This statement seemed contradictory until I realized this has nothing to do with the .locked property. Try setting the .style property to 2.
yes it worked! thank you thats all I needed. Setting the Combo1.Style to 2 just stops users typing into the Combo. If you want to stop users using the Combo1 then just set Combo1.Enabled = FALSE.
|