View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Clicking a picture

Just to clarify Kassie's response to you (in case this is all new to you),
there is an ActiveSheet object (with all the properties of a Sheet object)
that is set to the sheet that is currently active when the code is
executing. So, to get your active sheet's name, try something like this...

WhoCalledMe = ActiveSheet.Name

or this...

If ActiveSheet.Name = "Sheet1" Then

or any of a number of different ways.

Note that in the above If..Then statement, the logical test is case
sensitive.

--
Rick (MVP - Excel)


"Kassie" wrote in message
...
Exactly what do you mean by "detecting"?
If your macro refers to the active sheet, then whichever sheet "calls" it,
is still the active sheet.
If you tell us what your goal is, then maybe we can offer better
assistance

--
HTH

Kassie

Replace xxx with hotmail


"kirkm" wrote:

On Tue, 5 May 2009 23:19:01 -0700, Kassie
wrote:

That's because a single click selects the picture. If you rightclick on
this
picture, you can select Assign Macro, and use it as a command button
yes.
That is, if you have a macro that you want to "fire" using this picture
as a
button.


Thanks Kassie, that's exactly it. I'm setting it up now but
have struck a snag - I want to call the macro from 2 different sheets
and have the macro detect the name of the worksheet that called it.

Googling around but seem to find everything but. Do you know?

Thanks - Kirk