Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 361
Default Code to assign a macro to hundreds of option buttons at once

I have hundreds of option buttons that need to have the same macro assigned
to each (too many to do manually). I am doing this so that when a button is
selected it will change a cell in the worksheet and run a worksheet change
macro. Thanks in advance!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Code to assign a macro to hundreds of option buttons at once

If you want to assign the same macro to all (Forms style) optionbutons on
the sheet, simply

ActiveSheet.OptionButtons.OnAction = "myMacro"

Otherwise you will need to loop option buttons looking for something
particular about one of the properties to dictate the OnAction string.

In passing, if you mean call worksheet change event code I doubt that's the
best approach.

Regards,
Peter T


"Carl" wrote in message
...
I have hundreds of option buttons that need to have the same macro assigned
to each (too many to do manually). I am doing this so that when a button
is
selected it will change a cell in the worksheet and run a worksheet change
macro. Thanks in advance!



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
Assign different buttons by Macro Iraj Excel Discussion (Misc queries) 4 March 8th 09 01:31 AM
Code for creating option buttons OssieMac Excel Programming 2 March 23rd 07 09:01 AM
How to assign different Linked cells to option buttons furbiuzzu Excel Programming 2 November 22nd 06 03:42 AM
How to assign same code inside Option button code space ?? furbiuzzu Excel Programming 1 November 21st 06 02:36 PM
option buttons run Click code when value is changed via VBA code neonangel Excel Programming 5 July 27th 04 08:32 AM


All times are GMT +1. The time now is 02:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"