Once more to the experts...as I'm lost.
Hi folks,
I have an array that changes depending on which radio button is selected.
For example, below, the #1 radio button is selected so the 5-year correlation is shown. If #2 were selected then the 1-year shows up instead.
I would like to have conditional formatting also based on which radio button is selected.
In the example, if radio #1 selected, the array shown is the 5yr correlation and I would like to highlight the values between the threshold #s (-.1 to .1).
I can easily use conditional formatting between the values native to excel, but I cannot figure out how to make it dependent on the radio button selected so that each array can have different thresholds to color the cells.
When I try to record a macro to see how the radio button event is being captured, I don't get anything I can use...i think...
Thanks!
-Will
Hi folks,
I have an array that changes depending on which radio button is selected.
For example, below, the #1 radio button is selected so the 5-year correlation is shown. If #2 were selected then the 1-year shows up instead.
I would like to have conditional formatting also based on which radio button is selected.
In the example, if radio #1 selected, the array shown is the 5yr correlation and I would like to highlight the values between the threshold #s (-.1 to .1).
I can easily use conditional formatting between the values native to excel, but I cannot figure out how to make it dependent on the radio button selected so that each array can have different thresholds to color the cells.
When I try to record a macro to see how the radio button event is being captured, I don't get anything I can use...i think...
Thanks!
-Will
VBA Code:
Sub ButtonCondTest()
'
' ButtonCondTest Macro
Range("A2:D4").Select
Application.CutCopyMode = False
'Threshold Values
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlBetween, _
Formula1:="=$I$4", Formula2:="=$J$4"
'Is this the radio button? How to allow for 2 radio buttons each with independent formatting when selected?
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
'Formatting
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
End Sub