View Single Post
  #3   Report Post  
L. Howard Kittle
 
Posts: n/a
Default

Something like this will high light the row of any cell selected in the
range B8 to K22 from column B to K. You can change to meet your parameters.

Copy and paste into the sheet module. I don't remember if I wrote this or
picked it from the newsgroup, apologies to the author if not mine for not
crediting him/her.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Data As Range
Dim i As Integer
Dim j As Integer
Dim k As Integer
i = 2
j = 8
k = ActiveCell.Column()
Set Data = Range("B8:K22")

Data.Interior.ColorIndex = xlNone

If ActiveCell.Row < 8 Or ActiveCell.Row 22 Or _
ActiveCell.Column < 2 Or ActiveCell.Column 11 Then
Exit Sub
End If

ActiveCell.Offset(0, -(k - i)). _
Resize(1, 10).Interior.ColorIndex = 35

End Sub


And one from J. E. that does the whole row and preserves any other color
formatting on the sheet.

' J.E. McGimpsey 6/15/2001
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Static oldRange As Range
Static colorIndices(256) As Integer
Dim i As Integer

If Not oldRange Is Nothing Then 'Restore color indices
For i = 1 To 256
Cells(oldRange.row, i).Interior.ColorIndex = colorIndices(i)
Next i
End If
For i = 1 To UBound(colorIndices)
colorIndices(i) = Cells(ActiveCell.row, i).Interior.ColorIndex
Next i
ActiveCell.EntireRow.Interior.ColorIndex = 15
Set oldRange = ActiveCell.EntireRow
End Sub

HTH
Regards,
Howard

"blackrb1" wrote in message
...
As I scroll down the rows in Excel, the row number and the current cell
are
highlighted. Is there a way to have the entire row be highlighted as I
scroll?