macro to select option button in option group

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.
 
P

Patrick Molloy

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top