Disable notification when user clicks locked cell

der_roedie

New Member
Joined
Dec 16, 2009
Messages
29
Hello,

i've got the following problem:

I want users to double-click on a row on a protected sheet and then do some code based on the row-number of the clicked cell. I've protected the sheet because it contains a lot of formula's.

When a user double-clicks a row it triggers the code through the Workbook_SheetBeforeDoubleClick event.
After the code is executed Excel shows a message that the cell that was clicked was protected etc etc.

How can I prevent this message from popping up?

I've already tried
Code:
application.displaywarnings = false

but that didn't work :(

Thanks
 

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
Unlock the cells, so the message doesn't appear.
Set Validation on those cells to the formula =FALSE, so the user can't change the values.
 
Upvote 0
Try this

Rich (BB code):
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Cancel = True
'
'code
'
End Sub
 
Upvote 0
really that simple.... :oops:

This did the trick, Thanks!

What exactly does the cancel parameter do in this example? Does it cancel the popup or some kind of other action?
 
Upvote 0
Cancel prevents the default action of double clicking which is to put the cell in edit mode.
 
Upvote 0
Hi VoG,
As much i can get i need to paste it for individuall worksheet......
Is there some way that i can apply this for whole workbook...?
 
Upvote 0
In the ThisWorkbook module

Code:
Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
Cancel = True
'
'code
'
End Sub
 
Upvote 0
Greetings, VoG,

I have a similar question but in my case, I don't double-click! I try to enter a single character in a locked cell without getting the notification. How can I suppress the notification when entering a character in a locked cell (with a single click)?
 
Upvote 0
I'm not sure that you can but please start a new thread for this instead of tagging on to a rather old thread.
 
Upvote 0

Forum statistics

Threads
1,213,549
Messages
6,114,264
Members
448,558
Latest member
aivin

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