Select a protected cell

philR

Active Member
Joined
Feb 25, 2002
Messages
257
Is it possible to protect a cell against being altered, but still allow the user to select it and double click it?

Must be on here somewhere but I cant find it.

Many thanks
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
You can allow the user to select it like this: Make sure the cell is locked, then protect the sheet, and check the option to Select locked cells. But a double-click opens the cell for editing and editing a locked cell is never allowed; that is the whole point of a protected sheet.

If you are writing VBA, you can implement the Sub Worksheet_BeforeDoubleClick with
VBA Code:
Cancel = True
to allow actions to occur on a double-click without editing the cell, and that will be allowed even on a locked cell.

2020-05-28.png
 
Upvote 0
Perfect, thanks. When i did this and recorded it, it turns out the VBA code I was missing is:
Sheet1.EnableSelection = xlNoRestrictions
 
Upvote 0
It would have been helpful to note in your first post that this was a VBA question. Glad you got it solved.
 
Upvote 0

Forum statistics

Threads
1,214,950
Messages
6,122,428
Members
449,083
Latest member
Ava19

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