good morning all. I searched but couldn't find anything that helped me do what i want. what i want is to check a checkbox and if it is checked, select multiple cells and color them. I have managed to get the following figured out:
If Me.CheckBox1 = True Then
Cells(TextBox2, "A").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorLight2
.TintAndShade = 0.799981688894314
.PatternTintAndShade = 0
End With
Cells(TextBox2, "L").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorLight2
.TintAndShade = 0.799981688894314
.PatternTintAndShade = 0
End With
but i know there's got to be a way to shrink it into one action by having it select all the cells at once as opposed to selecting one cell, coloring, then selecting the next and so on. I just can't figure out how to do so. any pointers?
If Me.CheckBox1 = True Then
Cells(TextBox2, "A").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorLight2
.TintAndShade = 0.799981688894314
.PatternTintAndShade = 0
End With
Cells(TextBox2, "L").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorLight2
.TintAndShade = 0.799981688894314
.PatternTintAndShade = 0
End With
but i know there's got to be a way to shrink it into one action by having it select all the cells at once as opposed to selecting one cell, coloring, then selecting the next and so on. I just can't figure out how to do so. any pointers?