View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
L. Howard Kittle L. Howard Kittle is offline
external usenet poster
 
Posts: 698
Default Conditional Formatting of Entire Row when the Active Cell is in ro

Hi Shannon,

Try this from J.E

'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

"Shannon" wrote in message
...

I would like to highlight/shade the entire row that currently has the
active/selected cell. For example, whenever I am anywhere on row 10 I
would
like all of row 10 to be highlighted or shaded a certain colour. I have
been
looking for a function like ACTIVEROW or ACTIVECELL so that I can then use
conditional formatting, but can't find anything.

I am using EXCEL 2007.

Please help. Thanks.