ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Making code accessible to many buttons (https://www.excelbanter.com/excel-programming/284937-making-code-accessible-many-buttons.html)

S. S.[_2_]

Making code accessible to many buttons
 
I am trying to create several sheets with identical
buttons. I want the button to do the exact same thing
from each sheet. How do I make this code be in some
overhead location that any of the buttons can call it.
Right now the code seems to only be associated with the
one button on the one sheet. Only that button will call
the code. The other buttons do nothing.

Thoughts?
Does this make sense?

Thanks

S.S.



J.E. McGimpsey

Making code accessible to many buttons
 
Put your code in a regular code module. If your buttons are from the
Forms toolbar, right-click the buttons and choose Assign macro,
choosing your code. If your buttons are from the Controls toolbar,
call your code from the Button_Click() event.

In article ,
"S. S." wrote:

I am trying to create several sheets with identical
buttons. I want the button to do the exact same thing
from each sheet. How do I make this code be in some
overhead location that any of the buttons can call it.
Right now the code seems to only be associated with the
one button on the one sheet. Only that button will call
the code. The other buttons do nothing.



All times are GMT +1. The time now is 09:54 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com