macro to select option button in option group

  • Thread starter Thread starter cm
  • Start date Start date
C

cm

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.
 
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.
 
Back
Top