Conditional Formatting, although I suspect your formula
may be a tough one given that you're altering columns.
however you could do it using the sheet's Change method.
This fires when a new value is entered into a cell.
Remember that Change is NOT fired if a cell has a
formula, and the value changes as a result of a
recalculation. Conditional Formattting WILL change in
this case.
The following code shows how to test if an entry is made
into column "C" and then I used Select Case to pick row
12 ie C12
I used this since you can easily adapt it for other cells
in C as you indicate. However, you don't give any
algorithm to indicate how you'd select the other cells to
be formatted.
Paste the followign code into the sheet's code page. to
get to the code page quickly, just right-click the sheet
tab & select View Code,
Option Explicit
Private Sub Worksheet_Change(ByVal target As Range)
If target.Column = 3 Then
If target.Value = "ms" Then
Select Case target.Row
Case 12
setCell Range("H12,H10,H9")
Case Else
End Select
End If
End If
End Sub
Private Sub setCell(target As Range)
With target
.Borders(xlDiagonalDown).LineStyle = xlNone
.Borders(xlDiagonalUp).LineStyle = xlNone
With .Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With .Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With .Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With .Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
.Font.ColorIndex = 1
With .Interior
.ColorIndex = 15
.Pattern = xlSolid
End With
End With
End Sub
Patrick Molloy
Microsoft Excel MVP