View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Charlie Charlie is offline
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