Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default How to assign same code inside Option button code space ??

Hi all,

I've to assign the same VB code to all of my 200 option buttons inside
a sheet.
Do i have to write it manually for all buttons???

thanks for your help.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default How to assign same code inside Option button code space ??

Here is one way:

Private Sub CommandButtonName_Click()
'Do something
myMacro
End Sub

Sub myMacro()
'Do events, etc.
End Sub

Attach the Private Sub to the command button and put the macro you want to
run in the general code module. When you click the button it does whaterver
you had it there for plus it calls the myMacro from the general module.

"furbiuzzu" wrote:

Hi all,

I've to assign the same VB code to all of my 200 option buttons inside
a sheet.
Do i have to write it manually for all buttons???

thanks for your help.


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 Button code not working Sara Excel Discussion (Misc queries) 3 November 12th 08 06:09 PM
How to make a button VBA code reference other VBA code subroutines??? gunman[_9_] Excel Programming 4 September 27th 05 01:01 AM
option buttons run Click code when value is changed via VBA code neonangel Excel Programming 5 July 27th 04 08:32 AM
Code to tab from option button click Glen Millar Excel Programming 3 May 19th 04 02:14 AM
Assign code to button Nic[_2_] Excel Programming 3 February 22nd 04 10:49 AM


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

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"