Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how can I start a macro with a mouse click

Status
Not open for further replies.

petarr

Technical User
Apr 19, 2011
4
FR
Thats it... how can I start a macro with a mouse click?
 



Hi,

Put a button in you application that calls the macro on the click event?

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
ops sry... its Excel 2007

I'd like to have an option button so when I select the option button, I'd like to run the macro with any click, anywhere

For exemple I select Option button 1 and if I select a cell in the range A1:D20, the macro is eecuted

I hope I was clear
 
For eemple any cell i select in the range becomes green and a text appears
 


You need at least two Option Buttons.

Then use the Worksheet_SelectionChange event to run your macro.

What code do you have so far?

Have you placed a Option Buttons on your sheet?

Are you useing Control Toolbox or Forms controls?

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("B6:O11")) Is Nothing Then
...
I use option buttons
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top