Hi,
Im looking for VB code to hide a combo box based on the value of a cell.
For example if the user inputs a value of 100% or leaves blank I want the combo box below to be hidden.
Thanks
Hi,
Im looking for VB code to hide a combo box based on the value of a cell.
For example if the user inputs a value of 100% or leaves blank I want the combo box below to be hidden.
Thanks
Any help would be greatly appreciated!
Hi savio21,
See the attached. It all comes down to making the visible property on the combobox false or not, depending on the value in a cell.
I've put code behind the UserForm Activate that will check the value in A1 (you can change it to any cell) and it will hide or unhide the ComboBox based on that value.
One test is worth a thousand opinions.
Click the * Add Reputation below to say thanks.
It didnt quite work. I inserted a combobox instead of a data validation list into the excel workbook. How do I hide the combobox if its built into the worksheet instead of a user form? Also, as a follow up the name for the combobox appears to be Drop Down 12. Do I need to rename the box so it doesn't contain any spaces or can i use underscores?
Thanks
Hi savio21,
I didn't know your combobox was on the sheet itself. If it is on the sheet it is a "Shapes".
I put one on Sheet1 and then went to the immediate window and did:
debug.print Application.Worksheets(1).Shapes(1).Name and pressed enter. I tried "Shapes(2)" until I got a ComboBox. Then I added it to the attached code. Try the new version. I think you well see how it works.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks