sakkie6
06-15-2007, 05:12 AM
Hi
The following macro is on the forums to change the color of a row and column of the cell that you selected:
Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim RngRow As Range
Dim RngCol As Range
Dim RngFinal As Range
Dim Row As Long
Dim Col As Long
Cells.Interior.ColorIndex = xlNone
Row = Target.Row
Col = Target.Column
Set RngRow = Range("A" & Row, Target)
Set RngCol = Range(Cells(1, Col), Target)
Set RngFinal = Union(RngRow, RngCol)
RngFinal.Interior.ColorIndex = 6
End Sub
It does exactly what I want, but it changes the existing color on my spreadsheet to white. Is there any way to keep the existing color on my spreadsheet while highlighting the row of the cell selected?
Thanx
The following macro is on the forums to change the color of a row and column of the cell that you selected:
Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim RngRow As Range
Dim RngCol As Range
Dim RngFinal As Range
Dim Row As Long
Dim Col As Long
Cells.Interior.ColorIndex = xlNone
Row = Target.Row
Col = Target.Column
Set RngRow = Range("A" & Row, Target)
Set RngCol = Range(Cells(1, Col), Target)
Set RngFinal = Union(RngRow, RngCol)
RngFinal.Interior.ColorIndex = 6
End Sub
It does exactly what I want, but it changes the existing color on my spreadsheet to white. Is there any way to keep the existing color on my spreadsheet while highlighting the row of the cell selected?
Thanx