View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Little Elephant with Big Ears Little Elephant with Big Ears is offline
external usenet poster
 
Posts: 2
Default programming command bars

Hello,

I have a workbook with a number of sheets (over 100) and I would like to add
a commandbutton to the top of each sheet. The command button would have the
same functionality on each sheet. I have written the code to create the
button in a class module, and set up a loop to create the button on every
worksheet. I have written the code to run when the button is clicked in a
code module. Is there a way to assign a procedure to the click event of the
button without going into the code module for each worksheet and writing the
same call 100 times? The embedded button does not have an 'OnAction'
property or anything similar which can be set. I'm thinking there must be a
way to implement this in the class definition. I am aware that I could
create a toolbar or add a button to an existing toolbar or dropdown menu, but
the target audience for this workbook is not all that savvy and I would like
to make the functionality patently obvious to anyone who looks at this
workbook.

Thanks for any ideas