Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default unticking option buttons

I've had the following code suggested for clearing
option buttons (so they are made 'unchecked').

for each oleObje in ActiveSheet.OleObjects
if typeof oleObje.Object is MSforms.OptionButton then
oleObj.Object.Value=False
End If
Next

while the code is accepted, it doesn't do the job (i.e.
the boxes remain checked). Not sure if I'm meant to be
adding more code to make this work. Your help will be
appreciated.
Thank you.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default unticking option buttons

Here is what I posted:

for each oleObj in ActiveSheet.OleObjects
if typeof oleObj.Object is MSforms.OptionButton then
oleObj.Object.Value = False
End if
Next

Look at what you posted. Note that you have changed the spelling on two of
the three occurances of oleObj ( to oleObje) but not on the third occurance
which is where the box is unchecked.


Cleaned up what you posted and tested:

Sub Tester5()
For Each oleObje In ActiveSheet.OLEObjects
If TypeOf oleObje.Object Is MSForms.OptionButton Then
oleObje.Object.Value = False
End If
Next

End Sub

Tested in Excel 2000 and worked fine


Regards,
Tom Ogilvy



"Phil Perry" wrote in message
...
I've had the following code suggested for clearing
option buttons (so they are made 'unchecked').

for each oleObje in ActiveSheet.OleObjects
if typeof oleObje.Object is MSforms.OptionButton then
oleObj.Object.Value=False
End If
Next

while the code is accepted, it doesn't do the job (i.e.
the boxes remain checked). Not sure if I'm meant to be
adding more code to make this work. Your help will be
appreciated.
Thank you.



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
Unticking a Checkbox John Excel Discussion (Misc queries) 0 July 7th 09 03:28 PM
Option Buttons/Radio Buttons John Calder New Users to Excel 7 May 16th 08 03:51 AM
Option Buttons Bo0ts Excel Discussion (Misc queries) 4 December 6th 07 03:11 AM
option buttons CAOU Excel Worksheet Functions 1 April 20th 06 09:17 AM
Option Buttons Grant90 Excel Discussion (Misc queries) 1 July 29th 05 02:34 PM


All times are GMT +1. The time now is 10:27 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"