F
fishy
I have used Dave Petersons response (pasted below) to locking ranges and this
works if I use a font but I have a spreadsheet that uses conditional
formatting that when
=(F$4>=$C$4) then the cell pattern (Cell shading) goes Red (The third colour
down on the extreme left of the standard pallet in Excel 2002).
I am trying to lock the range if any of the cells are in that particular
shade of red. I need this to run after any cell on the page is updated.
'Daves code---------------------------------------
Option Explicit
Sub testme()
Dim myCell As Range
Dim myRng As Range
With ActiveSheet
Set myRng = .UsedRange
..Cells.Locked = True
End With
For Each myCell In myRng.Cells
If myCell.Font.ColorIndex = 5 Then
myCell.Locked = False
End If
Next myCell
End Sub
----------------------------------------------------
works if I use a font but I have a spreadsheet that uses conditional
formatting that when
=(F$4>=$C$4) then the cell pattern (Cell shading) goes Red (The third colour
down on the extreme left of the standard pallet in Excel 2002).
I am trying to lock the range if any of the cells are in that particular
shade of red. I need this to run after any cell on the page is updated.
'Daves code---------------------------------------
Option Explicit
Sub testme()
Dim myCell As Range
Dim myRng As Range
With ActiveSheet
Set myRng = .UsedRange
..Cells.Locked = True
End With
For Each myCell In myRng.Cells
If myCell.Font.ColorIndex = 5 Then
myCell.Locked = False
End If
Next myCell
End Sub
----------------------------------------------------