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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Launch Macro on Mouse event 1

Status
Not open for further replies.

Clarkie001

IS-IT--Management
Aug 26, 2003
59
GB
Hi,

Does anyone know how to launch a macro on a mouse event....particulary mouse click?

Any help in this would be great...thanks in advance.

Clarkie
 
You don't say which program you are using but if it is Excel you just need to use whichever of the Worsheet functions suits you best.
In the VBA editor click on the sheet which you wish to use with a mouse function. Instead of General, choose Worksheet and on the right you get the droplist of all the functions which go with Worksheet.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)

End Sub

Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)

End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

End Sub

Richard
 
Richard,

Sorry, Yes it is excel I was meaning.

I give that a try.....


Clarkie
 
Hi Richard,

That worked a treat.....Cheers
Clarkie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top