W
welded
I require the ability to conditionally format a rather large range o
cells from a macro and I'm thinking that a loop of some variety woul
be the ticket. However tonight was my first foray into VB so I'm no
all the sure what I'm doing yet, simple as it may be.
So here's the scenario:
PHP code
-------------------
sub macro()
Range("D13").Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:="=""x"""
Selection.FormatConditions(1).Font.ColorIndex = xlAutomatic
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=COUNTIF($D$13:$Q$13,""A"")=2"
Selection.FormatConditions(2).Font.ColorIndex = 46
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=COUNTIF($D$13:$Q$13,""A"")>=3"
Selection.FormatConditions(3).Font.ColorIndex = 3
cells from a macro and I'm thinking that a loop of some variety woul
be the ticket. However tonight was my first foray into VB so I'm no
all the sure what I'm doing yet, simple as it may be.
So here's the scenario:
PHP code
-------------------
sub macro()
Range("D13").Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:="=""x"""
Selection.FormatConditions(1).Font.ColorIndex = xlAutomatic
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=COUNTIF($D$13:$Q$13,""A"")=2"
Selection.FormatConditions(2).Font.ColorIndex = 46
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=COUNTIF($D$13:$Q$13,""A"")>=3"
Selection.FormatConditions(3).Font.ColorIndex = 3