Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Initialize Option Buttons
Greetings, all
I have 82 option buttons, and I want to write a routine which will set the value of all even-numbered option button numbers to TRUE. I tried: For i = 1 to 82 Step 2 Sheets("Data").OptionButton(i) = true Next i Not too surprisingly, this didn't work. I can write lines and lines of code to accomplish this, but am looking for a more efficient method. Any ideas? Thanks, Jeff |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Initialize Option Buttons
For i = 2 to 82 Step 2
Sheets("Data").OleObjects("OptionButton" _ & i).Object.value = true Next i This assumes each of the optionbuttons that are being changed are in separate groups. If they are all in the same group, then you can only set one to true. -- Regards, Tom Ogilvy "Jeff Wright" wrote in message news:VLbfe.13238$tQ.5676@fed1read06... Greetings, all I have 82 option buttons, and I want to write a routine which will set the value of all even-numbered option button numbers to TRUE. I tried: For i = 1 to 82 Step 2 Sheets("Data").OptionButton(i) = true Next i Not too surprisingly, this didn't work. I can write lines and lines of code to accomplish this, but am looking for a more efficient method. Any ideas? Thanks, Jeff |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Initialize Option Buttons
Thanks Tom! This does the trick.
Jeff "Tom Ogilvy" wrote in message ... For i = 2 to 82 Step 2 Sheets("Data").OleObjects("OptionButton" _ & i).Object.value = true Next i This assumes each of the optionbuttons that are being changed are in separate groups. If they are all in the same group, then you can only set one to true. -- Regards, Tom Ogilvy "Jeff Wright" wrote in message news:VLbfe.13238$tQ.5676@fed1read06... Greetings, all I have 82 option buttons, and I want to write a routine which will set the value of all even-numbered option button numbers to TRUE. I tried: For i = 1 to 82 Step 2 Sheets("Data").OptionButton(i) = true Next i Not too surprisingly, this didn't work. I can write lines and lines of code to accomplish this, but am looking for a more efficient method. Any ideas? Thanks, Jeff |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Option Buttons/Radio Buttons | New Users to Excel | |||
Option Buttons | Excel Discussion (Misc queries) | |||
Option Buttons | Excel Discussion (Misc queries) | |||
Option Buttons | Excel Programming | |||
Option Buttons | Excel Programming |