Color locked cells only in specified range
I assume the worksheet is unprotected when you run the code
Dim ws As Worksheet
Set ws = Worksheets("Pricing")
Dim ILastRow As Long, cell as Range
ILastRow = ws.Range("B:B").SpecialCells(xlCellTypeLastCell).R ow
For each cell in ws.Range("C6:C" & ILastRow)
With cell
.Select
if .Locked then
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:="=($B" & _
cell.row & =""*"")"
.FormatConditions(1).Interior.ColorIndex = 4
end if
End With
Next
ws.Range("C6").Select
--
Regards,
Tom Ogilvy
"BEEJAY" wrote:
In spite of someones efforts to help me, I am not able to modify or ?? the
following to work on locked cells (only) in the selected range in column C.
It is critical to the application. Will someone please help?
Dim ws As Worksheet
Set ws = Worksheets("Pricing")
Dim ILastRow As Long
ILastRow = ws.Range("B:B").SpecialCells(xlCellTypeLastCell).R ow
With ws.Range("C6:C" & ILastRow)
.Select
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:="=($B6=""*"")"
.FormatConditions(1).Interior.ColorIndex = 4
End With
ws.Range("C6").Select
|