Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
CM CM is offline
external usenet poster
 
Posts: 136
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 747
Default 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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I select an option button using code Ayo Excel Programming 2 January 6th 08 08:25 AM
need help on how to grey out one option button in one group box based on the selection of another option button in another group box George Excel Programming 12 March 11th 07 02:08 PM
De-Select an Option button Otto Moehrbach Excel Programming 3 February 12th 07 06:12 AM
Option buttons: How to get the selected option from a group? naddad Excel Programming 5 December 21st 05 05:09 PM
Option button group name Chad Excel Programming 4 August 26th 05 04:08 PM


All times are GMT +1. The time now is 08:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"