Alternate mouse click events

Sean Burnett

New Member
Joined
Mar 29, 2017
Messages
1
I have a workbook with many sheets, some of which i would like to allow users to open in new windows. My question is: from the home page (sheet1) i have buttons to direct users to different sheets, how can i use right click, shift-click, or something else to change the behavior of the buttons?

for example a simple left click will activate sheet2 but shift-click (or right click) will open sheet2 in a new window.

Sub SteelWeightCalculator_Click()
Worksheets("SteelWeightCalc").Visible = True
Worksheets("SteelWeightCalc").Activate
End Sub

Sub SteelWeightCalculator_?? BeforeRightClick() ??
ActiveWindow.NewWindow
Sheets("SteelWeightCalc").Activate
End Sub

Are buttons not the appropriate tool to use here?
Many thanks in advance.
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Hi Sean
Welcome to the board

Try inserting an activeX button.

Test with this:

Code:
Private Sub CommandButton1_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)

Select Case Button
    Case 1: MsgBox "Left click"
    Case 2: MsgBox "Right click"
End Select
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,869
Members
449,054
Latest member
juliecooper255

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top