Cancel=True not working on one worksheet in a workbook

kgartin

Board Regular
Joined
May 6, 2010
Messages
201
I have a workbook with multiple worksheets (Jan - Feb), each with a load of data. Each sheet is set up to change colors (among other things) if a cell is double-clicked and each private sub ends with cancel=true. On one of the sheets (Feb), it just doesn't work (although it HAS worked on that sheet until recently...no relevant changes have been made). All the other sheets function properly and do not go into the cells edit mode when double-clicked. February goes into edit mode every time. The code is the same for each sheet.

Any ideas why this is happening?
 
I was using it as a conditional format for a range of cells - IE
Code:
=and(isformula($F7),$AM7=$F7)

But even without that formula listed in conditional formatting the function itself was causing the sheet to behave improperly (when you double click a cell, it would ignore cancel=true and go into cell edit mode. It would basically ignore the last lines of code after "end with" which was where cancel=true was located). Very weird. No idea why.
 
Upvote 0

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Lol! Thanks товарищ!
:cool:

Each cell with UDF in CF calls that UDF numerous times
You may set break point on that UDF via F9 to check this behavior, but apply UDF to CF of one cell only to not hang Excel for a long time

Some suggestions:
1. Try moving this line of the code Cancel = True to the top of the Sub Worksheet_BeforeDoubleClick to be sure it will play anyway.
2. In the early release (pre SP2) of Excel 2007 a double click event did not work in case dropdown list was used in the cell. Hope it's not your case, but please test a double click event on cells without dropdowns.
3. ISFORMULA cell function comes with Excel 2013 which can be used safely in CF in Excel 2013/2016.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,652
Messages
6,120,746
Members
448,989
Latest member
mariah3

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