Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default 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
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
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 Grant90 Excel Discussion (Misc queries) 1 July 29th 05 02:34 PM
Option Buttons Robin Clay[_3_] Excel Programming 3 August 10th 04 06:30 PM
Option Buttons Keri[_2_] Excel Programming 1 June 14th 04 05:00 PM


All times are GMT +1. The time now is 04:00 PM.

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"