Hi All,
I want to add conditional formatting using VBA from Access inserted into my excel spreadsheet.
I am unable to find specific code example that inserts the rules correctly (my desired rules which are displayed the attachment above).
Here are some failed code attempts:
Can you help me?
Code:
With sh.Name
'With Range("A2:A30").FormatConditions.Add(xlCellValue, xlGreater, "400")
'With Range("I2:I30").FormatConditions.Add(xlCellValue, xlEqual, "R")
'With Range("I2:I30").FormatConditions.Add(xlCellValue, xlEqual, "R")
'With Range("I2:I30").FormatConditions.Add("$AF2", xlEqual, "R")
'With Range("I2:I30").FormatConditions.Add("$AF2", xlEqual, "R")
'With Range("I2:I30").FormatConditions.Add (Type:=xlExpression, Formula1: "=$AF2="R"")
'With Range("I2:I30").FormatConditions.Add (Type: =xlexpression, Formula1:="=$AF2="R"")
'With Range("I2:I30").FormatConditions.Add(Type:=xlExpression, Formula1:="=$G2=$D2")
'With Range("I2:I30").FormatConditions.Add(Type:=xlExpression, Operator:=xlEqual, Formula1:="=$AF2="R"")
'With Range("I2:I30").FormatConditions.Delete
'With Range("I2:I30").FormatConditions.Add(Type:=xlExpression, Formula:="=$AF2=R"")
With Range("I2:I30").FormatConditions.Add(xlExpression, "=$AF2=R")
With .Interior
.ColorIndex = 36
End With
End With
End With
.
Many Thanks
Kody_Devl