[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]D
[/TD]
[TD]E
[/TD]
[TD]F
[/TD]
[TD]G
[/TD]
[TD]H
[/TD]
[TD]I
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Invoice Date
[/TD]
[TD]Amount
[/TD]
[TD]Check Date
[/TD]
[TD]Check #
[/TD]
[TD]$ Inv Paid
[/TD]
[TD]Check $
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]6/1/2002
[/TD]
[TD]$5000
[/TD]
[TD]6/23/2002
[/TD]
[TD]1234
[/TD]
[TD]$0.00
[/TD]
[TD]$0.00
[/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]5/1/2003
[/TD]
[TD]$4400
[/TD]
[TD]5/15/2003
[/TD]
[TD]4576
[/TD]
[TD]$4400
[/TD]
[TD]$8000
[/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD]7/5/2004
[/TD]
[TD]$100
[/TD]
[TD]7/28/2004
[/TD]
[TD]9886
[/TD]
[TD]$500
[/TD]
[TD]$6000
[/TD]
[/TR]
</tbody>[/TABLE]
Happy New Year! I need some guidance for creating vba code to run multiple conditional formatting rules.
Here's what I have so far..
With Range("F2").FormatConditions.Add(Type:=xlExpression, Formula1:="=D2+20>F2")
.Interior.Color = RGB(248, 203, 173)
End With
Range("F2").NumberFormat = "m/d/yyyy"
With Range("H2").FormatConditions.Add(Type:=xlCellValue, Operator:=xlNotEqual, Formula1:="=E2")
.Interior.Color = RGB(248, 203, 173)
End With
With Range("I2").FormatConditions.Add(Type:=xlCellValue, Operator:=xlLess, Formula1:="=H2")
.Interior.Color = RGB(248, 203, 173)
End With
<tbody>[TR]
[TD][/TD]
[TD]D
[/TD]
[TD]E
[/TD]
[TD]F
[/TD]
[TD]G
[/TD]
[TD]H
[/TD]
[TD]I
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Invoice Date
[/TD]
[TD]Amount
[/TD]
[TD]Check Date
[/TD]
[TD]Check #
[/TD]
[TD]$ Inv Paid
[/TD]
[TD]Check $
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]6/1/2002
[/TD]
[TD]$5000
[/TD]
[TD]6/23/2002
[/TD]
[TD]1234
[/TD]
[TD]$0.00
[/TD]
[TD]$0.00
[/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]5/1/2003
[/TD]
[TD]$4400
[/TD]
[TD]5/15/2003
[/TD]
[TD]4576
[/TD]
[TD]$4400
[/TD]
[TD]$8000
[/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD]7/5/2004
[/TD]
[TD]$100
[/TD]
[TD]7/28/2004
[/TD]
[TD]9886
[/TD]
[TD]$500
[/TD]
[TD]$6000
[/TD]
[/TR]
</tbody>[/TABLE]
Happy New Year! I need some guidance for creating vba code to run multiple conditional formatting rules.
- On Column F = D2+20>F2 Check date must be 20 days after invoice date, if not = condl highlight
- On Column H = H2<>E2 Amount should = $ Inv Paid, if not = condl highlight
- On Column I = I2<H2 Check $ must be greater than $ Inv Paid, if not = condl
Here's what I have so far..
With Range("F2").FormatConditions.Add(Type:=xlExpression, Formula1:="=D2+20>F2")
.Interior.Color = RGB(248, 203, 173)
End With
Range("F2").NumberFormat = "m/d/yyyy"
With Range("H2").FormatConditions.Add(Type:=xlCellValue, Operator:=xlNotEqual, Formula1:="=E2")
.Interior.Color = RGB(248, 203, 173)
End With
With Range("I2").FormatConditions.Add(Type:=xlCellValue, Operator:=xlLess, Formula1:="=H2")
.Interior.Color = RGB(248, 203, 173)
End With