I'm a total noob at vba, so forgive me if this is a simple fix.
Last time I were here, I got some nice person to help me with this:
Just a 'simple' sub to grey out the line of cells that have been toggled by checkbox.
I would like to change this to toggle multiple lines with 1 checkbox. Say, if my checkbox is linked to A32:A35. My original assumption were that I could fiddle with the Offset, but I can't figure out how, without being forced to make a new sub for each specific amount of lines, I would like to effect.
Please don't just give me the correct answer. I'd love to be able to understand why as well.
Thanks in advance
Last time I were here, I got some nice person to help me with this:
Code:
Sub ToggleGrey()
Dim ChkBox As Excel.CheckBox
Set ChkBox = ActiveSheet.CheckBoxes(Application.Caller)
With Range(ChkBox.LinkedCell).Offset(0, 1).Resize(1, 7).Interior
If ChkBox.Value = xlOn Then
.ColorIndex = 16
Else
.ColorIndex = xlColorIndexNone
End If
End With
End Sub
Just a 'simple' sub to grey out the line of cells that have been toggled by checkbox.
I would like to change this to toggle multiple lines with 1 checkbox. Say, if my checkbox is linked to A32:A35. My original assumption were that I could fiddle with the Offset, but I can't figure out how, without being forced to make a new sub for each specific amount of lines, I would like to effect.
Please don't just give me the correct answer. I'd love to be able to understand why as well.
Thanks in advance