There are methods using sheetchange events but the easiest method is to use
Chip Pearson's RowLiner add-in.
http://www.cpearson.com/excel/RowLiner.htm
Just a note...........Rowliner won't work on protected sheets.
If your sheet is protected you need event code pasted into the sheet module.
Right-click on the sheet tab and "View Code" Paste into that module.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Static OldCell As Range
If Application.CutCopyMode = 0 Then
ActiveSheet.Unprotect Password:="justme"
If Not OldCell Is Nothing Then
With OldCell.EntireRow
.Interior.ColorIndex = xlColorIndexNone
.Borders.LineStyle = xlLineStyleNone
End With
End If
Set OldCell = Target
With OldCell.EntireRow
.Interior.ColorIndex = 6
.EntireRow.Borders.LineStyle = xlContinuous
End With
Else
If OldCell Is Nothing Then
Set OldCell = Target
Else
Set OldCell = Union(OldCell, Target)
End If
End If
ActiveSheet.Protect Password:="justme"
End Sub
Will color the active row yellow.
Note: will wipe out existing background color of activecell cell unless BG
color is due to CF
Gord Dibben MS Excel MVP
On Fri, 5 Feb 2010 16:29:01 -0800, Cindy
wrote:
Is there any function for me to set up color change for the row that I am
working on, so, I won't mistype row for my worksheet?