ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to highlight active row and column? (https://www.excelbanter.com/excel-programming/327811-how-highlight-active-row-column.html)

Ricktaxx

How to highlight active row and column?
 
I have a very large table and I am hoping to find a way to highligh the
current row and coloum somehow to allow a crosshair like look that follows
the active cell. The table is a look up table and following the lines can be
a pain even with grided shading.

Toppers

How to highlight active row and column?
 
Try:

ActiveCell.EntireRow.Interior.ColorIndex = 4
ActiveCell.EntireColumn.Interior.ColorIndex = 7

HTH


"Ricktaxx" wrote:

I have a very large table and I am hoping to find a way to highligh the
current row and coloum somehow to allow a crosshair like look that follows
the active cell. The table is a look up table and following the lines can be
a pain even with grided shading.


Bob Phillips[_6_]

How to highlight active row and column?
 
'----------------------------------------------------------------
Private Sub WorkSheet_SelectionChange(ByVal Target As Range)
'----------------------------------------------------------------

Cells.FormatConditions.Delete
With Target.EntireRow
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
.FormatConditions(1).Interior.ColorIndex = 35
End With
With Target.EntireColumn
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
.FormatConditions(1).Interior.ColorIndex = 35
End With
With Target
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
.FormatConditions(1).Interior.ColorIndex = 36
End With


End Sub


'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



--

HTH

RP
(remove nothere from the email address if mailing direct)


"Ricktaxx" wrote in message
...
I have a very large table and I am hoping to find a way to highligh the
current row and coloum somehow to allow a crosshair like look that follows
the active cell. The table is a look up table and following the lines can

be
a pain even with grided shading.




Barmaley

How to highlight active row and column?
 
That is way too cool

Thanks BOB, I will use it too

AvP

"Bob Phillips" wrote in message
...
'----------------------------------------------------------------
Private Sub WorkSheet_SelectionChange(ByVal Target As Range)
'----------------------------------------------------------------

Cells.FormatConditions.Delete
With Target.EntireRow
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
.FormatConditions(1).Interior.ColorIndex = 35
End With
With Target.EntireColumn
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
.FormatConditions(1).Interior.ColorIndex = 35
End With
With Target
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
.FormatConditions(1).Interior.ColorIndex = 36
End With


End Sub


'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



--

HTH

RP
(remove nothere from the email address if mailing direct)


"Ricktaxx" wrote in message
...
I have a very large table and I am hoping to find a way to highligh the
current row and coloum somehow to allow a crosshair like look that

follows
the active cell. The table is a look up table and following the lines

can
be
a pain even with grided shading.






Bob Phillips[_6_]

How to highlight active row and column?
 
Improved version (IMO)

'----------------------------------------------------------------
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
.Interior.ColorIndex = 20
End With
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
.Interior.ColorIndex = 20
End With
End With

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

End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Bob Phillips" wrote in message
...
'----------------------------------------------------------------
Private Sub WorkSheet_SelectionChange(ByVal Target As Range)
'----------------------------------------------------------------

Cells.FormatConditions.Delete
With Target.EntireRow
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
.FormatConditions(1).Interior.ColorIndex = 35
End With
With Target.EntireColumn
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
.FormatConditions(1).Interior.ColorIndex = 35
End With
With Target
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
.FormatConditions(1).Interior.ColorIndex = 36
End With


End Sub


'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



--

HTH

RP
(remove nothere from the email address if mailing direct)


"Ricktaxx" wrote in message
...
I have a very large table and I am hoping to find a way to highligh the
current row and coloum somehow to allow a crosshair like look that

follows
the active cell. The table is a look up table and following the lines

can
be
a pain even with grided shading.







All times are GMT +1. The time now is 08:18 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com