Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Clearing Option Buttons
I have a set of 80 Option Buttons (from Control Toolbox) in a questionaire.
I want to clear all of them after a macro posts the results to another sheet. I can clear them individually with this line in my code like this (for Option Button 79): ActiveSheet.OptionButton79.Object.Value = False For some reason, if I generalize this by trying to clear them with a loop, it fails. Here is the code I have tried unsuccessfully to use: Sub ClearOptBut() Dim i As Integer For i = 1 To 80 ActiveSheet.OptionButton(i).Object.Value = False Next i End Sub It hangs up on ActiveSheet.OptionButton(i).Object.Value = False |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Clearing Option Buttons
Hi
try (not tested): Sub ClearOptBut() Dim i As Integer For i = 1 To 80 with ActiveSheet.controls("OptionButton" & i) .Value = False end with Next i End Sub -- Regards Frank Kabel Frankfurt, Germany "dsimcox" schrieb im Newsbeitrag ... I have a set of 80 Option Buttons (from Control Toolbox) in a questionaire. I want to clear all of them after a macro posts the results to another sheet. I can clear them individually with this line in my code like this (for Option Button 79): ActiveSheet.OptionButton79.Object.Value = False For some reason, if I generalize this by trying to clear them with a loop, it fails. Here is the code I have tried unsuccessfully to use: Sub ClearOptBut() Dim i As Integer For i = 1 To 80 ActiveSheet.OptionButton(i).Object.Value = False Next i End Sub It hangs up on ActiveSheet.OptionButton(i).Object.Value = False |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Clearing Option Buttons | Excel Discussion (Misc queries) | |||
Option Buttons/Radio Buttons | New Users to Excel | |||
option buttons help | Excel Worksheet Functions | |||
option buttons | Excel Worksheet Functions | |||
option buttons | Excel Programming |