Detecting selection before click

M

MrT

Hello,
On a sheet, I have two shapes (say two Ovals) and an ActiveX button. Let's
select one of the two shapes. I want to know when I click on the button, what
shape was selected before the button got activated. I could not find an
answer after searching for a while as there no event such as beforeclick.
Thanks in advance for any help,
MrT
 
M

MrT

Well, I've just found the answer: you need to set the TakeTheFocus property
to false ...
 
G

Gary''s Student

If you use a Forms button rather than a Controls button:

Sub WhoGotClicked()
MsgBox (Selection.Name)
End Sub

will tell you which Shape got clicked.
 
M

MrT

The problem of form buttons is that you cannot control many things such as
background color.
 
G

Gary''s Student

If your interest is in background color, you can assign a macro to any piece
from the Drawing toolbar and assign any color to the shape.

Of course, this ruins your ultimate goal of capturing the shape that got
clicked!
 

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

Top