nikki333
07-28-2018, 02:53 PM
Hi folks
I'm trying to set a conditional formating rule via VBA. The macro recorder doesn't seem to pick up anything (useful) in my case.
Basically, it's about checking whether the cell value in column B match one out of three criteria, and then to format the frame and interior color of the whole row in question.
So far I've benn trying like so:
With rngKriterien
.FormatConditions.Add Type:=xlExpression, Formula1:="=$B4=ODER(""Rüster-unabhängig""; ""Rüster-abhängig""; ""Allergenmonitoring"")"
.FormatConditions(rngKriterien.FormatConditions.Count).SetFirstPriority
With .FormatConditions(1)
With .Borders(xlInsideHorizontal): .Color = strColor1: End With
With .Borders(xlInsideVertical): .Color = strColor1: End With
End With
End With
This works to set a rule with the formula and doesn't give any error message, however, it seems to ignore the .borders alltogether.
Any ideas?
Cherrio
I'm trying to set a conditional formating rule via VBA. The macro recorder doesn't seem to pick up anything (useful) in my case.
Basically, it's about checking whether the cell value in column B match one out of three criteria, and then to format the frame and interior color of the whole row in question.
So far I've benn trying like so:
With rngKriterien
.FormatConditions.Add Type:=xlExpression, Formula1:="=$B4=ODER(""Rüster-unabhängig""; ""Rüster-abhängig""; ""Allergenmonitoring"")"
.FormatConditions(rngKriterien.FormatConditions.Count).SetFirstPriority
With .FormatConditions(1)
With .Borders(xlInsideHorizontal): .Color = strColor1: End With
With .Borders(xlInsideVertical): .Color = strColor1: End With
End With
End With
This works to set a rule with the formula and doesn't give any error message, however, it seems to ignore the .borders alltogether.
Any ideas?
Cherrio