T Zhang
T Zhang

Reputation: 105

Excel VBA hide the form control buttons

I have created an "Expandable/Collapsible" structure using VBA. I have added some form controls, like a dropdown or option buttons in each of the section, but the issue is that, when the whole thing is collapsed, the form controls are visible in the button. please check the screenshot and advise a solution. excel issue

enter image description here

Upvotes: 4

Views: 813

Answers (1)

Siddharth Rout
Siddharth Rout

Reputation: 149335

Yes that is because you have not selected Move and Size with cells.

That option is greyed out when you right click on the control and then click on Format Controls | Properties | Move and Size with cells for Option Button and Combo Box as shown below.

enter image description here

You need to use a different way to activate it.

Click the control and then click as shown below

enter image description here

And then from there you can set those properties.

enter image description here

Now those controls will hide when you collapse the rows.

Upvotes: 3

Related Questions