Wolfgang
09-05-2007, 12:59 PM
Hi All...
I have a range of numbers in column A down to cell A113
Using Conditional Formatting manually does the trick
Using some profound code below will color ALL cells when fired...
Where should I be embarrassed???!!!
Best,
Wolfgang
Sub COLOR_BY_CF()
Range("A2").Select
Range("=OFFSET($A$2,,,COUNTA($A:$A)-1,1)").FormatConditions.Delete
Range("=OFFSET($A$2,,,COUNTA($A:$A)-1,1)").FormatConditions.Add Type:=xlExpression, Formula1:= _
"=MOD(SUM(N($A$1:$A1<>$A$2:$A2)),2)"
Range("=OFFSET($A$2,,,COUNTA($A:$A)-1,1)").FormatConditions(1).Interior.ColorIndex = 36
End Sub
I have a range of numbers in column A down to cell A113
Using Conditional Formatting manually does the trick
Using some profound code below will color ALL cells when fired...
Where should I be embarrassed???!!!
Best,
Wolfgang
Sub COLOR_BY_CF()
Range("A2").Select
Range("=OFFSET($A$2,,,COUNTA($A:$A)-1,1)").FormatConditions.Delete
Range("=OFFSET($A$2,,,COUNTA($A:$A)-1,1)").FormatConditions.Add Type:=xlExpression, Formula1:= _
"=MOD(SUM(N($A$1:$A1<>$A$2:$A2)),2)"
Range("=OFFSET($A$2,,,COUNTA($A:$A)-1,1)").FormatConditions(1).Interior.ColorIndex = 36
End Sub