Don't know about the error, maybe Chip, or someone else will see this and
have an answer, you could try this code. To put in this macro right click on
the worksheet tab and view code, in the window that opens paste this code,
press Alt and Q to close this window and go back to your workbook.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'will highlight the current row and column, up to the cell pointer in a
light yellow color
'***************
'NOTE: DON'T USE IF YOU HAVE CONDITIONAL FORMATTING THAT YOU WANT TO KEEP!
'***************
Dim iColor As Integer
On Error Resume Next
iColor = Target.Interior.ColorIndex
If iColor < 0 Then
iColor = 36
Else
iColor = iColor + 1
End If
'// Need this test incase Font color is the same
If iColor = Target.Font.ColorIndex Then iColor = iColor + 1
Cells.FormatConditions.Delete
'// Horizontal color banding
With Range("A" & Target.Row, Target.Address) 'Rows(Target.Row)
.FormatConditions.Add Type:=2, Formula1:="TRUE"
.FormatConditions(1).Interior.ColorIndex = iColor
End With
'// Vertical color banding
With Range(Target.Offset(1 - Target.Row, 0).Address & ":" &
Target.Offset(-1, 0).Address) 'Rows(Target.Row)
.FormatConditions.Add Type:=2, Formula1:="TRUE"
.FormatConditions(1).Interior.ColorIndex = iColor
End With
End Sub
--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 97
** remove news from my email address to reply by email **