PaigeDelotta
New Member
- Joined
- Mar 24, 2014
- Messages
- 1
Hello, I've searched everywhere and cannot find a solution to my situation. Many thanks in advance for any guidance.
I have a macro that conditionally formats a column of variable row length to certain conditions based on the values found in an adjacent column, for which I used the following code:
Dim myR As Long
Range("C10:C" & myR).Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=D10>0.05"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.ThemeColor = xlThemeColorDark1
.TintAndShade = -0.349986266670736
End With
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = -0.349986266670736
End With
Selection.FormatConditions(1).StopIfTrue = False
However, now I have a situation where not only do I have a variable amount of rows, but I also a variable amount of columns needing formatting.
For example I'd need to format columns C:H based on scores in columns I:N. I'm not having an issue selecting the variable rows and variable columns of what will be formatted, but I can't figure out how to reference a variable starting place for this part of the code as found above: "Formula1:="=D10>0.05"
Any ideas on this? I'm a newbie and self taught, mainly through forums like these. I would appreciate any and all assistance! Thanks
I have a macro that conditionally formats a column of variable row length to certain conditions based on the values found in an adjacent column, for which I used the following code:
Dim myR As Long
Range("C10:C" & myR).Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=D10>0.05"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.ThemeColor = xlThemeColorDark1
.TintAndShade = -0.349986266670736
End With
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = -0.349986266670736
End With
Selection.FormatConditions(1).StopIfTrue = False
However, now I have a situation where not only do I have a variable amount of rows, but I also a variable amount of columns needing formatting.
For example I'd need to format columns C:H based on scores in columns I:N. I'm not having an issue selecting the variable rows and variable columns of what will be formatted, but I can't figure out how to reference a variable starting place for this part of the code as found above: "Formula1:="=D10>0.05"
Any ideas on this? I'm a newbie and self taught, mainly through forums like these. I would appreciate any and all assistance! Thanks
