I have a table, "Table8" as it's named, in Excel 2013. I have a spreadsheet where I add daily to-do items where I sort, mark completed, and so forth using a few buttons. I wanted to add a button to highlight an individual table row to indicate that I've worked on that task today and there's nothing more to do.
So, for example, I'll click on the first cell in the row, in Column "A", and then I would click the button and the row would get shaded.
This code works but I'm sure there's a better way to do it, plus, if I have more cells filled in I'm concerned that I'll end up highlighting the whole entire excel worksheet row. I know how to select a whole table to clear the formatting; how do you select just one row?
Thanks!!
Matt
So, for example, I'll click on the first cell in the row, in Column "A", and then I would click the button and the row would get shaded.
This code works but I'm sure there's a better way to do it, plus, if I have more cells filled in I'm concerned that I'll end up highlighting the whole entire excel worksheet row. I know how to select a whole table to clear the formatting; how do you select just one row?
Code:
Private Sub CommandButton3_Click()
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorLight1
.TintAndShade = 0.349986266670736
.PatternTintAndShade = 0
End With
End Sub
Thanks!!
Matt