Highlight selected row

  • Thread starter Thread starter Markl
  • Start date Start date
M

Markl

Is there any way that when I am entering data in a spreadsheet, as
move to each row the whole row is highlighted ?

Thank
 
Right click sheet tab>view code>insert this>save

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells.Interior.ColorIndex = xlColorIndexNone
Target.EntireRow.Interior.ColorIndex = 36
End Sub
 
i found this real fancy stuff on the web, but it is quite heavy on th
memory. it highlights both the column and the row. but with this (o
for that matter the other piece given by Don) you will not be able t
have any other formatting on the sheet. put this piece in th
particular sheet where you want the highlighting. i have stopped usin
it, for the simple reason that after first couple of days, the spee
gets on the nerves.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Cells.FormatConditions.Delete

With Target

With .EntireRow
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"

With .FormatConditions(1)

With .Borders(xlTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 5
End With

With .Borders(xlBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 5
End With

End With

.FormatConditions(1).Interior.ColorIndex = 48
End With

With .EntireColumn
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"

With .FormatConditions(1)

With .Borders(xlLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 5
End With

With .Borders(xlRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 5
End With

End With

.FormatConditions(1).Interior.ColorIndex = 48
End With

.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
.FormatConditions(1).Interior.ColorIndex = 15
End With

End Su
 

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

Back
Top