ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Clicking a picture (https://www.excelbanter.com/excel-programming/428040-clicking-picture.html)

kirkm[_8_]

Clicking a picture
 

I've got a small picture on Row 1 in my worksheet.

Can it be used to fire an event? I notice a single click
selects handles around it - and d-click brings up the Format
window. Can these be disabled ?

Thanks - Kirk

kassie

Clicking a picture
 
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.

--
HTH

Kassie

Replace xxx with hotmail


"kirkm" wrote:


I've got a small picture on Row 1 in my worksheet.

Can it be used to fire an event? I notice a single click
selects handles around it - and d-click brings up the Format
window. Can these be disabled ?

Thanks - Kirk


kirkm[_8_]

Clicking a picture
 
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

kassie

Clicking a picture
 
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


Rick Rothstein

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



kirkm[_8_]

Clicking a picture
 
On Wed, 6 May 2009 09:14:09 -0700, Kassie
wrote:

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


I did !! ActiveSheet was it.

Thanks - Kirk

kirkm[_8_]

Clicking a picture
 

On Wed, 6 May 2009 12:46:44 -0400, "Rick Rothstein"
wrote:

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.


Thanks Rick... I'm still finding out about objects, properties etc
etc
ActiveSheet.Name solved everything. Now I want ActiveSheet.CurrentRow
but, well, you know - it ain't there! I left a new question on that.
Cheers - Kirk


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

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