Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Protecting cells by coluor
I have used 3 colours in my spreadsheet 1 for headings /titles, 1 fo data entry and 1 for calculated fields. How can I protect all cell with a specific colour to prevent users from changing contents formul -- st12086 ----------------------------------------------------------------------- st120869's Profile: http://www.excelforum.com/member.php...fo&userid=1833 View this thread: http://www.excelforum.com/showthread.php?threadid=48424 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Protecting cells by coluor
Protects all cells which are coloured Light Yellow (colour index 36):
Sub PrtcColor() Dim cell As Range With ActiveSheet .Unprotect For Each cell In .UsedRange If cell.Interior.ColorIndex = 36 Then cell.Locked = True Else cell.Locked = False End If Next cell .Protect End With End Sub Hope this helps Rowan st120869 wrote: I have used 3 colours in my spreadsheet 1 for headings /titles, 1 for data entry and 1 for calculated fields. How can I protect all cells with a specific colour to prevent users from changing contents / formula |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Protecting cells by coluor
Great, thanks this works. As an aside it will not work if any cells are merged - took a while to work this one out as I kept on getting an error message. -- st120869 ------------------------------------------------------------------------ st120869's Profile: http://www.excelforum.com/member.php...o&userid=18330 View this thread: http://www.excelforum.com/showthread...hreadid=484245 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Protecting cells by coluor
You're welcome. You will find a lot of things don't work with merged
cells. As a result I never use them. Regards Rowan st120869 wrote: Great, thanks this works. As an aside it will not work if any cells are merged - took a while to work this one out as I kept on getting an error message. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Protecting Cells | Excel Discussion (Misc queries) | |||
protecting the cells | Excel Discussion (Misc queries) | |||
Protecting Cells | Excel Worksheet Functions | |||
Help with protecting cells | Excel Programming | |||
Protecting certain cells | Excel Programming |