#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default On Action

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!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default On Action

Thank you soooooo much!!!



"Greg Wilson" wrote:

Try:

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

Regards,
Greg

"borg" wrote:

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!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excell copy action pauses for 15 second for the smallest action Meekal Excel Discussion (Misc queries) 1 January 28th 10 04:30 PM
Allow no action to be taken Smitty[_2_] Excel Worksheet Functions 4 January 23rd 08 10:52 PM
what is an OLE action funkymonkUK[_65_] Excel Programming 2 August 31st 05 12:31 PM
an OLE Action Charles Excel Programming 0 September 14th 04 06:24 AM
if ... then action tony wong[_2_] Excel Programming 1 June 17th 04 02:05 PM


All times are GMT +1. The time now is 12:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"