Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Unticking a Checkbox | Excel Discussion (Misc queries) | |||
Option Buttons/Radio Buttons | New Users to Excel | |||
Option Buttons | Excel Discussion (Misc queries) | |||
option buttons | Excel Worksheet Functions | |||
Option Buttons | Excel Discussion (Misc queries) |