Where have I mentioned fornatting C5:E5 apart from to say that's what's your code does.
I've adde 2 lines of code to format C9 based on whether the checkbox is clicked or not.
This is the original code.
Sub hsa_Click()
If Sheet1.CheckBoxes("hsa").Value = 1 Then
Range("C5:E5").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Else
Range("C5:E5").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = -0.499984740745262
.PatternTintAndShade = 0
End With
End If
End Sub
This is the code with the lines I added highlighted in red.
Sub hsa_Click()
If Sheet1.CheckBoxes("hsa").Value = 1 Then
Range("C5:E5").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Range("E9").Interior.ColorIndex = 3
Else
Range("C5:E5").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = -0.499984740745262
.PatternTintAndShade = 0
End With
Range("E9").Interior.ColorIndex = xlNone
End If
End Sub
I've uploaded the file https://www.box.com/s/bi1bm5bme26w2mb4i8f4
Bookmarks