Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 157
Default Disable optionbutton

Hi Everyone
What would be the code to disable option buttons.
I tried this but no success
ActiveSheet.Shapes("OptionButton1").enable = False
TIA
Regards
Cimjet


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 157
Default Disable optionbutton

Also I forgot to mention, I would like to disable about 24 Option button, it
would be better if I could disable then all with one command if possible.
thanks
Cimjet
"Cimjet" wrote in message
...
Hi Everyone
What would be the code to disable option buttons.
I tried this but no success
ActiveSheet.Shapes("OptionButton1").enable = False
TIA
Regards
Cimjet



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Disable optionbutton

Also I forgot to mention, I would like to disable about
24 Option button, it would be better if I could disable
then all with one command if possible.


You also forgot to mention where you got the OptionButtons from... the Forms
toolbar or the (ActiveX) Control Toolbox toolbar. Here is code for both (the
macro name should tell you which is which)...

Sub DisableFormsOptionButtons()
Worksheets("Sheet 1").OptionButtons.Enabled = False
End Sub

Sub DisableActiveXOptionButtons()
Dim OptBtn As OLEObject
For Each OptBtn In Worksheets("Sheet 1").OLEObjects
OptBtn.Object.Enabled = False
Next
End Sub

Rick Rothstein (MVP - Excel)

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 157
Default Disable optionbutton

Hi Rick
Sorry about that, I should have known better. You also forgot to mention where
you got the OptionButtons from.<<
It was an ActiveX control.
Thank you everything is working fine.
Regards
Cimjet

"Rick Rothstein" wrote in message
...
Also I forgot to mention, I would like to disable about
24 Option button, it would be better if I could disable
then all with one command if possible.


You also forgot to mention where you got the OptionButtons from... the Forms
toolbar or the (ActiveX) Control Toolbox toolbar. Here is code for both (the
macro name should tell you which is which)...

Sub DisableFormsOptionButtons()
Worksheets("Sheet 1").OptionButtons.Enabled = False
End Sub

Sub DisableActiveXOptionButtons()
Dim OptBtn As OLEObject
For Each OptBtn In Worksheets("Sheet 1").OLEObjects
OptBtn.Object.Enabled = False
Next
End Sub

Rick Rothstein (MVP - Excel)


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
Disable Optionbutton Control badgerzz1 Excel Programming 2 June 2nd 08 12:29 PM
Optionbutton help Craig[_21_] Excel Programming 5 November 25th 05 10:04 PM
OptionButton value Patrick Simonds Excel Programming 2 January 17th 05 10:50 AM
OptionButton nrage21[_70_] Excel Programming 0 September 29th 04 12:23 AM
Better Way to Use OptionButton [email protected] Excel Programming 0 September 1st 04 07:18 PM


All times are GMT +1. The time now is 09:26 AM.

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"