Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there a way reference a excel shape with a macro attached to it when you
have clicked onto it? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Option Explicit
Sub testme() Dim myShp As Shape Set myShp = ActiveSheet.Shapes(Application.Caller) With myShp MsgBox .Name & vbLf & .TopLeftCell.Address & vbLf & .Name End With End Sub Jason Zischke wrote: Is there a way reference a excel shape with a macro attached to it when you have clicked onto it? -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Some additional macros working with Shapes, but not
from a macro attached to the shape, like you asked and Dave answered, but you might find something you want to add to Dave's example. http://www.mvps.org/dmcritchie/excel/shapes.htm --- HTH, David McRitchie, Microsoft MVP - Excel My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Jason,
Application.Caller will return a text string with the name of the shape. Thus, you can get a reference through the Shapes collection. E.g., MsgBox ActiveSheet.Shapes(Application.Caller).Name -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Jason Zischke" wrote in message ... Is there a way reference a excel shape with a macro attached to it when you have clicked onto it? |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Yes
Right click on the excel shape, select Attach Macro. Assign the corresponding macro. When you move the mouse over the shape a hand will appear. Click to run the attached macro. "Jason Zischke" wrote: Is there a way reference a excel shape with a macro attached to it when you have clicked onto it? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
excel document with shapes on it but the shapes do not print | Excel Worksheet Functions | |||
Naming Auto Shapes and Creating new Shapes | Excel Discussion (Misc queries) | |||
When drawing shapes in excel the shapes keep disappearing | Excel Discussion (Misc queries) | |||
How can i get more 3D shapes for Auto shapes in excel? | Excel Discussion (Misc queries) | |||
How can i get more 3D shapes for Auto shapes in excel? | Excel Discussion (Misc queries) |