Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 414
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 414
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Protecting Cells J4shaw Excel Discussion (Misc queries) 1 August 21st 09 11:57 AM
protecting the cells David Biddulph[_2_] Excel Discussion (Misc queries) 0 August 21st 08 11:04 AM
Protecting Cells Luck3356 Excel Worksheet Functions 0 September 23rd 06 06:55 PM
Help with protecting cells Prometheus[_9_] Excel Programming 4 October 6th 05 09:59 PM
Protecting certain cells William Spence Excel Programming 1 March 6th 05 10:58 PM


All times are GMT +1. The time now is 08:10 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"