Right click on the worksheet tab and choose view code. Paste the following in when the VB editor comes up.
Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Cells.Interior.ColorIndex = -4142
Target.EntireRow.Interior.ColorIndex = 8
End Sub
What this does is highlight the row that the active cell is in with a shade of blue. If you want the column and row both highlighted then add this above the End Sub:
Target.EntireColumn.Interior.ColorIndex = 8
Rick
Perfect, just what I'm looking for. Do you have a list of complete color index numbers with colors and how can I have this on all spreadsheets I work on.
Thanks,
David
David,
Run this subroutine and you'll get a listing of the colors and their index numbers for the colors on your pallette.
Sub ColorIndices() For i = 1 To 56
Cells(i, 1).Interior.ColorIndex = i
Cells(i, 2).Value = i
Next i
End Sub
The operative words are "on your pallette." That's because you can change colors and their locations (index numbers) by going to Tools > Options > Color and modifying the shades available to you.
have fun
David to get it to run on all of your workbooks, open each workbook and right click on the Excel icon next to FILE on the toolbar. Choose View Code and then paste the following in:
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
Cells.Interior.ColorIndex = -4142
Target.EntireRow.Interior.ColorIndex = 8
End Sub
This will make it available to every worksheet in that workbook.
Glad it does what you wanted it to :)
Rick