Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Disable Excel Control
While in Design mode, when you select a control, its name should be displayed
in the Name box (on the left of the excel formula bar). So: - if the Formula bar is not visible, you can display it by going in menu View Formula Bar - to switch modes Design/Run, click the Design Mode icon from the Visual Basic toolba. You can display this toolbar through the menu View Tollbars Visual Basic. VBA: For OLEObjects controls, they should be directly accessible: Sheet1.Combobox1.ListIndex For other objects, you should be able to access them through the Shapes collection: Activesheet.Shapes("Chek Box 3")... I hope this helps, Sebastien "wysimdnwyg" wrote: I have a control on my worksheet (not a User Form) that I want to disable or remove when a certain field is populated. The problem is, I can not find the name of the control. I can get to the 'Format Control' window, but that's no help. Where can I find the name of that control? thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Disable Excel Control
You're welcome.
Accessing control properties: -In the case of an OLECOntrol (the ones from the Control Toolbox toobar): 'Example with a checkbox Dim cbx As MSForms.CheckBox Set cbx = ActiveSheet.OLEObjects("Checkbox1") cbx.Enabled = False -In the case of a Form (the ones from the Forms toolbar, or drawing toolbar) Dim shCbx As CheckBox Set shCbx = ActiveSheet.CheckBoxes("Check Box 3") shCbx.Enabled = False Regards, Sebastien "wysimdnwyg" wrote: Well, now I feel a little stupid and a little blind. That helps, and I thank you. One more question, though. Now that I've found the control name, I can't get it to disable. I've tried .disable, .enable = false and .visible=false. Thanks "sebastienm" wrote: While in Design mode, when you select a control, its name should be displayed in the Name box (on the left of the excel formula bar). So: - if the Formula bar is not visible, you can display it by going in menu View Formula Bar - to switch modes Design/Run, click the Design Mode icon from the Visual Basic toolba. You can display this toolbar through the menu View Tollbars Visual Basic. VBA: For OLEObjects controls, they should be directly accessible: Sheet1.Combobox1.ListIndex For other objects, you should be able to access them through the Shapes collection: Activesheet.Shapes("Chek Box 3")... I hope this helps, Sebastien "wysimdnwyg" wrote: I have a control on my worksheet (not a User Form) that I want to disable or remove when a certain field is populated. The problem is, I can not find the name of the control. I can get to the 'Format Control' window, but that's no help. Where can I find the name of that control? thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Disable and enable dropdown combobox(Form Control) | Excel Discussion (Misc queries) | |||
How do I disable the ActiveX Control prompt? | Excel Discussion (Misc queries) | |||
How to DISABLE THE CONTROL BREAK shortcut keys | Excel Programming | |||
Disable control down (cntl D) on a worksheet | Excel Programming | |||
Disable Control s | Excel Programming |