I came across this code that works however, I could really use your help to tweak-it a little for my needs.
I would like this code to run on every new sheet that gets created within my workbook automatically, rather than me pasting this code manually into each sheet as it gets created.
There must be a more elegant solution no doubt.
From what I've read the solution has to do with adding the code to a Module.
I'm a newbie to VBA Coding and would very much appreciate your assistance in creating a solution that works for my needs.
Note - is there a way to exclude the 1st Row from the coding as the 1st Row are Column descriptions only.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
Application.ScreenUpdating = False
'Clear the color of all cells
Cells.Interior.ColorIndex = 0
With Target
'Highlight row and column of the selected cell
.EntireRow.Interior.ColorIndex = 38
End With
Application.ScreenUpdating = True
End Sub
I would like this code to run on every new sheet that gets created within my workbook automatically, rather than me pasting this code manually into each sheet as it gets created.
There must be a more elegant solution no doubt.
From what I've read the solution has to do with adding the code to a Module.
I'm a newbie to VBA Coding and would very much appreciate your assistance in creating a solution that works for my needs.
Note - is there a way to exclude the 1st Row from the coding as the 1st Row are Column descriptions only.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
Application.ScreenUpdating = False
'Clear the color of all cells
Cells.Interior.ColorIndex = 0
With Target
'Highlight row and column of the selected cell
.EntireRow.Interior.ColorIndex = 38
End With
Application.ScreenUpdating = True
End Sub