![]() |
macro to select option button in option group
I need macro to select an option button when the workbook opens. The option
button is named "Optionbutton1" and the linked cell is named "typechoice". (Option button is part of an option group (of 3 buttons) called "type". Linked cells for the other two are 'typechoice2' and typechoice3') The linked cells are in a hidden column (unprotected cell) in a protected sheet. Please advise on the proper way to do this. -- cm |
macro to select option button in option group
Private Sub Workbook_Open()
Sheets("sheet1").OptionButton1 = True End Sub On Oct 20, 8:24*pm, cm wrote: I need macro to select an option button when the workbook opens. The option button is named "Optionbutton1" and the linked cell is named "typechoice".. (Option button is part of an option group (of 3 buttons) called "type". Linked cells for the other two are 'typechoice2' and typechoice3') The linked cells are in a hidden column (unprotected cell) in a protected sheet. Please advise on the proper way to do this. -- cm |
macro to select option button in option group
open the VBA editor (ALT+F11)
In the Project Explorer (Ctrl+R) right click on the icon for ThisWorkbook, select View Code and paste the following : Option Explicit Private Sub Workbook_Open() Worksheets("???").Range("TypeChoice") = 1 End Sub Please change ??? for the worksheet name. usually the first option will put a 1 in the linked cell. Just check that this is so. "cm" wrote: I need macro to select an option button when the workbook opens. The option button is named "Optionbutton1" and the linked cell is named "typechoice". (Option button is part of an option group (of 3 buttons) called "type". Linked cells for the other two are 'typechoice2' and typechoice3') The linked cells are in a hidden column (unprotected cell) in a protected sheet. Please advise on the proper way to do this. -- cm |
All times are GMT +1. The time now is 08:40 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com