Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Identifing Locked Cells

I have a fairly complex spreadsheet that requires salespeople to fill in
info. Many cells are locked from being changed. Is there a way to create a
macro that looks a current sheet and will change the cell color if cell is
locked (or unlocked)? Right now I review by going from cell, to, cell, to
cell.....

Any suggestions is MUCH appreciated....
Steve



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 709
Default Identifing Locked Cells

Steve, here is one way,

Sub Highlight_Locked_Cells()

'will color all locked cells in the sheet

Dim Cel As Range

For Each Cel In ActiveSheet.UsedRange.Cells

If Cel.Interior.ColorIndex = 46 Then Cel.Interior.ColorIndex = 0

Next

For Each Cel In ActiveSheet.UsedRange.Cells

If Cel.Locked = True Then Cel.Interior.ColorIndex = 46

Next

Exit Sub

End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003



"Steve Klenner" wrote in message
...
I have a fairly complex spreadsheet that requires salespeople to fill in
info. Many cells are locked from being changed. Is there a way to create
a macro that looks a current sheet and will change the cell color if cell
is locked (or unlocked)? Right now I review by going from cell, to, cell,
to cell.....

Any suggestions is MUCH appreciated....
Steve





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 75
Default Identifing Locked Cells

Rather than a macro, can you set up a format Style and apply it to
locked cells? You could set up the cell color using the Style you
define.

Mark


Steve Klenner wrote:
I have a fairly complex spreadsheet that requires salespeople to fill in
info. Many cells are locked from being changed. Is there a way to create a
macro that looks a current sheet and will change the cell color if cell is
locked (or unlocked)? Right now I review by going from cell, to, cell, to
cell.....

Any suggestions is MUCH appreciated....
Steve


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Identifing Locked Cells

Paul -

The Macro Worked like a charm.

Steve


"Steve Klenner" wrote in message
...
I have a fairly complex spreadsheet that requires salespeople to fill in
info. Many cells are locked from being changed. Is there a way to create
a macro that looks a current sheet and will change the cell color if cell
is locked (or unlocked)? Right now I review by going from cell, to, cell,
to cell.....

Any suggestions is MUCH appreciated....
Steve





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
Identifing Weeks in a Month. GEM Excel Discussion (Misc queries) 4 July 31st 09 03:46 AM
Locked worksheet & hyperlinks (w/ select locked cells unchecked) dgold82 Excel Discussion (Misc queries) 1 July 10th 09 09:42 PM
Identifing smallest numbers M Moore Excel Discussion (Misc queries) 1 August 29th 06 02:34 PM
Put comments on a locked spreadsheet even though cells not locked RDP Excel Worksheet Functions 1 September 11th 05 11:59 PM
I want the macros to be locked up when cells are locked up. Ed Excel Programming 6 February 20th 05 01:31 AM


All times are GMT +1. The time now is 10:06 PM.

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"