- Save your spreadsheet as a .xlsm (macro-enabled spreadsheet)
- Press ALT+F11
- Double-left-click your worksheet (e.g. Sheet1)
- Paste in the following nine lines of VBA code
If Target.Cells.Count > 1 Then Exit Sub
Application.ScreenUpdating = False
Cells.Interior.ColorIndex = 0
With Target
.EntireRow.Interior.ColorIndex = 36
End With
Application.ScreenUpdating = True
End Sub
Go back to your spreadsheet and select a different cell. The entire row of that cell is now highlighted in yellow, as shown below. If yellow isn't appealing, you can play around changing the value of the ColorIndex from 36 to other choices. Visit the following link to see your options.
https://msdn.microsoft.com/en-us/library/cc296089(v=office.12).aspx#xlDiscoveringColorIndex_ColorIndexProperty
No comments:
Post a Comment