Worksheet_BeforeDoubleClick not firing

mbt2103

New Member
Joined
Aug 4, 2014
Messages
35
I have the following code in all four sheets of a workbook I'm working on:
Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Cancel = True
Debug.Print Target.Address
End Sub
It doesn't do anything, in any of the sheets.

When I put it in a fresh workbook, it works just fine. :confused::confused::confused:
 
Last edited:

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Try typing this in the intermediate window
Code:
?application.EnableEvents
if it says False then events have been disabled
 
Upvote 0
Try typing this in the intermediate window
Code:
?application.EnableEvents
if it says False then events have been disabled


Wooooaaah. "?" is shorthand for "debug.print "?!?!!

That's amazing, and I am unnecessarily excited.
 
Upvote 0
Wooooaaah. "?" is shorthand for "debug.print "?!?!!
Only within the the intermediate window.
In the code you have to use debug.print

Have a good weekend
 
Upvote 0
Only within the the intermediate window.
In the code you have to use debug.print
You can type Debug.? in a module if you want, but VB will automatically expand the question mark to the word Print once you commit the line of code.
 
Upvote 0
You can type Debug.? in a module if you want, but VB will automatically expand the question mark to the word Print once you commit the line of code.

Never new that, admittedly I checked that you couldn't just use the ? in the code & noticed it change to Print. But didn't think to put the two together.
 
Upvote 0
I checked that you couldn't just use the ? in the code & noticed it change to Print.
The conversion of a solitary question mark to the Print keyword is left over from the compiled versions of Visual Basic (whose core code lies at the heart of VBA) where you were allowed to use the Print command directly to write on the surface of the Form (somewhat equivalent to VBA's UserForm, but with differences, obviously) as well as its PictureBox control.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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