View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
JLatham JLatham is offline
external usenet poster
 
Posts: 3,365
Default Can I set up a macro to run when a click a moninated cell ?

Sam, there are a couple of easier ways to do it than picking on a particular
cell to activate the macro. If you just use a cell you have to then add code
to some worksheet event such as _SelectionChange or _OnDoubleClick to detect
and test which cell got selected/clicked in and then decide which macro to
run based on that test.

You can use buttons from the Forms icon toolbar (View | Toolbars | Forms) to
do the same thing easier - you put the button on a sheet and put appropriate
text in it to tell what it does. You can then right-click on it and [Assign
macro] and choose an existing macro to be run when you click on it, or you
can build a new macro associated with it that will be named something like
Button01_Click().

You can even get more creative by using shapes and text boxes from the
Drawing toolbar (again: View | Toolbars | Drawing) and you can pretty them up
with color and with the TextBox you can do some fancier things with the text
in them. You can then right-click and do the Assign Macro thing with them
also.

You can pretty much [Assign Macro] to anything you can put onto a sheet or
form in Excel - even pictures!

"Sam" wrote:

I want to set up a macro in a worksheet to run when I click a cetain cell in
a worksheet rather than going to tools,macro,macros,clicking on the macro
name & run.