Detecting selection before click

  • Thread starter Thread starter MrT
  • Start date Start date
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
 
Well, I've just found the answer: you need to set the TakeTheFocus property
to false ...
 
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.
 
The problem of form buttons is that you cannot control many things such as
background color.
 
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!
 
Back
Top