On Action

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have drawn a rectangle and assigned a macro to it. When I click on this
rectangle, I would like the macro to display the position of the rectangle.

My macro looks something like this:

sub macro1
msgbox selection.top
end sub

I am guessing this doesn't work because the rectangle is not selected when
the macro is running? If you can help, it is greatly appreciated.

Thanks!
 
Thank you soooooo much!!!



Greg Wilson said:
Try:

Sub test()
With ActiveSheet.Shapes(Application.Caller)
MsgBox "Top = " & .Top & vbCr & "Left = " & .Left
End With
End Sub

Regards,
Greg
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top