Shape with a Macro to Clear Data Entry Cells doesn't work on Protected Sheet

FRED_SHEET

New Member
Joined
Oct 13, 2017
Messages
48
I have a shape with a Macro to clear five data entry cells. I have unlocked the data entry cells and protected the worksheet. However when I click on the shape to clear the data it doesn't work on the protected sheet.

Is there something I have to do different to the Macro, unlocked data entry cells, or protected sheet to make this work?
 

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.
Shapes have a Locked property just like cells (locked by default when sheet is protected). The only other solution I can think of is to have an event macro that calls that shape macro, but you may have to do some testing to see which event would be best (shape may not be selectable when sheet is locked).
 
Upvote 0
You can use something like this
Code:
Private Sub Workbook_Open()
Sheets("[COLOR=#ff0000]Details[/COLOR]").Protect Password:="[COLOR=#ff0000]Fluff[/COLOR]", userinterfaceonly:=True
End Sub
This needs to go in the ThisWorkbook module. Change sheet name & password to suit
 
Upvote 0
You can use something like this
Code:
Private Sub Workbook_Open()
Sheets("[COLOR=#ff0000]Details[/COLOR]").Protect Password:="[COLOR=#ff0000]Fluff[/COLOR]", userinterfaceonly:=True
End Sub
This needs to go in the ThisWorkbook module. Change sheet name & password to suit

Fanastic! MrExcel MVP that did the trick. For a self taught Excel user some of these Visual Basic Modules are pretty amazing. I was brought up using Fortran and a slide rule and I am still trying to understand Visual Basic.

Thanks for your help. :)
 
Upvote 0
Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,214,594
Messages
6,120,436
Members
448,964
Latest member
Danni317

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