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

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Von Pookie

MrExcel MVP
Joined
Feb 17, 2002
Messages
13,686
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

marcs

Active Member
Joined
May 3, 2005
Messages
420
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

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
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

marcs

Active Member
Joined
May 3, 2005
Messages
420
thanks jonmo1,

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

Heimir
 
Upvote 0

Forum statistics

Threads
1,191,132
Messages
5,984,851
Members
439,920
Latest member
mejatom

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
Top