View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz JLGWhiz is offline
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.