View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default 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