ehizzlefosho
New Member
- Joined
- Oct 2, 2018
- Messages
- 3
Hello all,
I am having an issue with the
I would like my conditional formatting to be dynamic. this code will be connected to a macro where it will repeat the conditional formatting however may times the user wants along a series of columns. if this code starts at b9, and a conditional formatting rule reference b4. A macro will repeat twice and the first time around the code starts at c9 and should reference c4, and a second time starts at d9 and references d4, and so forth and so forth however many times I would like to repeat the process.
Regards,
Eric
Also posted here https://www.excelforum.com/excel-programming-vba-macros/1247600-conditional-formatting-vba-help.html
I am having an issue with the
Code:
Formula1:=
Regards,
Eric
Code:
<code style="margin: 0px; padding: 0px; font-style: inherit; font-weight: inherit; line-height: 12px;"> Sub Macro9()
'
' Macro9 Macro
'
'
Range("B9").Select
Application.CutCopyMode = False
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=$B$4"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.Color = -16383844
.TintAndShade = 0
End With
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 13551615
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Application.CutCopyMode = False
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreater, _
Formula1:="=$B$3"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.Color = -16383844
.TintAndShade = 0
End With
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 13551615
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Application.CutCopyMode = False
Application.CutCopyMode = False
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlBetween, _
Formula1:="=$B$4", Formula2:="=$B$3"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.Color = -16752384
.TintAndShade = 0
End With
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 13561798
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:="="""""
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.ThemeColor = xlThemeColorDark1
.TintAndShade = 0
End With
With Selection.FormatConditions(1).Interior
.Pattern = xlNone
.TintAndShade = 0
End With
End Sub</code>
Also posted here https://www.excelforum.com/excel-programming-vba-macros/1247600-conditional-formatting-vba-help.html
Last edited by a moderator: