worksheet after double click event

stubarny

New Member
Joined
Apr 7, 2011
Messages
41
Hello,

Please could you tell me the procedure name for an after click event?

This works for a BEFORE double click event:

Private Sub Worksheet_BeforeDoubleClick

But I thought this would work for an AFTER double click event (but it doesn't):

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



Thanks for any help you can give,

Stu
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
I need a user to be able to double click on a formula and be taken to the source, but I need to ensure that I leave their computer settings unchanged.

I'd like to find the user's value for Application.EditDirectyInCell, then set Application.EditDirectyInCell to FALSE, then carry out the double click action, then set Application.EditDirectyInCell back to what the user originally had set on their computer.

Thanks,

Stu
 
Upvote 0
Maybe like this

Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim setting As Boolean
setting = Application.EditDirectlyInCell
Application.EditDirectlyInCell = False
'
'more code
'
Application.EditDirectlyInCell = setting
End Sub

Or maybe better

Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Cancel = True
'
'more code
'
End Sub
 
Upvote 0
Stu

What 'source'?

The formula precedents?

How would you move to them, hyperlink?
 
Upvote 0
Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Cancel = True
'
'more code
'
End Sub

Thanks VoG, using your code above how should I get the target range from the formula (this is sometimes a cell reference and sometimes a name range)?

If I just use ActiveCell.Formula as below then the GoTo fails:

Application.Goto Reference:=Worksheets("Tab Name").Range("ActiveCell.Formula")
 
Upvote 0
If the formula is simply like

=B27

then try

Code:
Application.Goto Reference:=Worksheets("Tab Name").Range(Right(ActiveCell.Formula, Len(ActiveCell.Formula) - 1))
 
Upvote 0

Forum statistics

Threads
1,224,527
Messages
6,179,331
Members
452,907
Latest member
Roland Deschain

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