Highlight row ?

Z

Zabi

Anyone know if this is possible with excel ?

Example: Excel "cursor" is now at B3, it should highlight row 3 (ie.
with different color). When i press "arrow down" cursor is on B4 and
excel should automatically highlight row 3 etc. etc.

Will be very grateful if someone can help me!

-Jari
 
D

Don Guillett

right click sheet tab>view code>insert this

'McCurdy.Here is something inspired by Don Guillett.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim MyRng As Range
Set MyRng = Target.EntireRow
Application.EnableEvents = False
On Error GoTo end1
Application.Cells.FormatConditions.Delete
With MyRng
.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=ROW()=ROW(INDIRECT(CELL(""address"")))"
With .FormatConditions(1).Font
.Bold = True
.Italic = False
.ColorIndex = 1
End With
.FormatConditions(1).Interior.ColorIndex = 36
End With
end1:
Application.EnableEvents = True
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top