Hello,
Does anyone know how I can automatically create a new tab with this Private Sub as the source code OR apply this code to every tab in a workbook? I need it to be automated, I cannot ask the user to paste it into the source code of every new tab.
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 = 15
End Sub
Thanks in advance,
Chad
Bookmarks