Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,814
Default conditional formatting

for a particular worksheet, if a cell is locked, i want it to be filled in
with a color. How can this be accomplished?

Thank you,

Steve
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default conditional formatting

I presume you mean the cell has become locked by a macro?
Here are some examples to include in the macro:

If Range("B2").Locked Then Range("B2").Interior.Color = vbYellow
If Cells(3, 3).Locked Then Cells(3, 3).Interior.Color = vbGreen

Dim Cell As Range

For Each Cell In Range("A1:J6")
If Cell.Locked Then Cell.Interior.Color = RGB(150, 180, 220)
Next Cell


"steve" wrote:

for a particular worksheet, if a cell is locked, i want it to be filled in
with a color. How can this be accomplished?

Thank you,

Steve

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,393
Default conditional formatting

Select the entire worksheet by clicking the empty area where the row and
column headers meet in the top left of the workspace
Use Format|Conditional Format and in the ensuing dialog box use: Formula is
=CELL("protect",A1)=1
Of course this must be done before protection is switched on!
best wishes

--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"steve" wrote in message
...
for a particular worksheet, if a cell is locked, i want it to be filled in
with a color. How can this be accomplished?

Thank you,

Steve



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default conditional formatting

Activesheet.Unprotect
for each cell in activesheet.usedrange
if cell.locked then cell.interior.colorIndex = 3
Next
Activesheet.Protect

--
Regards,
Tom Ogilvy

"steve" wrote in message
...
for a particular worksheet, if a cell is locked, i want it to be filled in
with a color. How can this be accomplished?

Thank you,

Steve



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,393
Default conditional formatting

Forgot to add:
Use Format|Conditional Format and in the ensuing dialog box use:
Formula is =CELL("protect",A1)=1
****** and set the colour needed******
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"Bernard Liengme" wrote in message
...
Select the entire worksheet by clicking the empty area where the row and
column headers meet in the top left of the workspace
Use Format|Conditional Format and in the ensuing dialog box use: Formula
is =CELL("protect",A1)=1
Of course this must be done before protection is switched on!
best wishes

--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"steve" wrote in message
...
for a particular worksheet, if a cell is locked, i want it to be filled
in
with a color. How can this be accomplished?

Thank you,

Steve







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,814
Default conditional formatting

you guys rock

"Bernard Liengme" wrote:

Forgot to add:
Use Format|Conditional Format and in the ensuing dialog box use:
Formula is =CELL("protect",A1)=1
****** and set the colour needed******
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"Bernard Liengme" wrote in message
...
Select the entire worksheet by clicking the empty area where the row and
column headers meet in the top left of the workspace
Use Format|Conditional Format and in the ensuing dialog box use: Formula
is =CELL("protect",A1)=1
Of course this must be done before protection is switched on!
best wishes

--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"steve" wrote in message
...
for a particular worksheet, if a cell is locked, i want it to be filled
in
with a color. How can this be accomplished?

Thank you,

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
How can I convert conditional formatting into explicit formatting? Patrick Harris Excel Discussion (Misc queries) 0 April 9th 09 12:00 AM
Conditional formatting--different formatting depending on cell con Tammy S. Excel Discussion (Misc queries) 3 March 30th 09 08:11 PM
Formatting Conditional Formatting Icon Sets The Rook[_2_] Excel Discussion (Misc queries) 3 March 7th 09 08:48 PM
Protect Cell Formatting including Conditional Formatting Mick Jennings Excel Discussion (Misc queries) 5 November 13th 07 05:32 PM
Conditional Formatting that will display conditional data BrainFart Excel Worksheet Functions 1 September 13th 05 05:45 PM


All times are GMT +1. The time now is 06:09 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"