Is this wise? protecting sheets using colour of cells.

marcs

Active Member
Joined
May 3, 2005
Messages
420
I've started building a workbook to be used by builders (basically Joe Public) to estimate building costs. So it basically lists building jobs (taken from a library) and there is an area where costs are inputted and a Gantt chart etc. There are scores of macros (nearly all event change) to build up lists, rename things, move things about in the list, delete them etc.

Protection is obviously important and I started out using protect/unprotect a lot and it got very messy. I've now changed to a different method of protection. All the cells are background coloured except cells which the user can input numbers into. They are xlnone. Clicking on any coloured cell either causes a particular relevant macro to start or it throws the cursor off the sheet into a hidden cell (e.g. if they click somewhere down on row 10000)

It seems to be working very well but I'm worried about unforseen problems. Particularly I'm not clear about what happens if the user has redefined their colour palette.

I'd value opinions on this whole thing

Heimir.
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Particularly I'm not clear about what happens if the user has redefined their colour palette.
Well, I don't think users can redefine the 'none' color, so you could simply write the code to check if the selected cell is colored or not.

For example: If Target.Interior.ColorIndex <> xlNone Then...

However, this won't work for conditional formatting.
 
Upvote 0
Thank you Kristy,

that's useful, - the nocolour not being redefinable.

I wonder if anyone has any other thoughts

and, by the way, thanks for helping maintain such a splendid web site!

Heimir.
 
Upvote 0
One thing you can try out...

ActiveSheet.Protect userInterfaceOnly:=True, Password:="Password"


This makes it so you no longer have to Unprotect / Reprotect the sheet in your code.
 
Upvote 0
thanks jonmo1,

I've actually got that on as well to protect shapes from being edited.
cheers

Heimir
 
Upvote 0

Forum statistics

Threads
1,213,544
Messages
6,114,239
Members
448,555
Latest member
RobertJones1986

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