Thread
:
Highlighting the active row
View Single Post
#
2
Posted to microsoft.public.excel.programming
Don Guillett[_4_]
external usenet poster
Posts: 2,337
Highlighting the active row
Have a look in the ThisWorkbook module & put the code within the
Private Sub Workbook_SheetSelectionChange(
--
Don Guillett
SalesAid Software
"Daniel Bonallack" wrote in
message ...
Bob Philips provided the code below in answer to someone's question. It
highlights the line of the active cell. This is SO useful to my team,
that I
want to be able to add it to any worksheet we use.
1. Is there a way to make a macro that adds code (the code below) to the
active worksheet? (I would then make an addin for the group that copies
in
the below)
2. If not, can the below be applied easily to every sheet in a workbook?
3. If I wanted this to be part of the default workbook (Excel XP), how
would I do this? Would it then be present on every sheet added?
Daniel
(PS, thanks Bob)
_________________________________
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells.FormatConditions.Delete
With Target.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 = 20
End With
End Sub
Reply With Quote
Don Guillett[_4_]
View Public Profile
Find all posts by Don Guillett[_4_]