Is it possible to automaticly highlight the entire row and column when I
select an certain cell?
Is it possible to automaticly highlight the entire row and column when I
select an certain cell?
you may want to try Chip Pearson's Rowliner:
http://www.cpearson.com/excel/RowLiner.htm
gcaramaliu wrote:
>
> Is it possible to automaticly highlight the entire row and column when I
> select an certain cell?
--
Dave Peterson
Here's another way
'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.
'----------------------------------------------------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'----------------------------------------------------------------
Cells.FormatConditions.Delete
With Target
.EntireRow.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
AddRowBorders Target.EntireRow
With .EntireColumn
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
End With
AddColumnBorders Target.EntireColumn
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
.FormatConditions(1).Interior.ColorIndex = 36
End With
End Sub
Private Sub AddRowBorders(pRow As Range)
With pRow
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
.Interior.ColorIndex = 20
End With
End With
End Sub
Private Sub AddColumnBorders(pColumn As Range)
With pColumn
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
.Interior.ColorIndex = 20
End With
End With
End Sub
--
HTH
Bob Phillips
(remove nothere from email address if mailing direct)
"gcaramaliu" <gcaramaliu@discussions.microsoft.com> wrote in message
news:336DB70A-3E11-4C8D-97F3-554966C7561B@microsoft.com...
> Is it possible to automaticly highlight the entire row and column when I
> select an certain cell?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks