Hi.
So the following seems to work in highlighting the activie cells correctly.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.ScreenUpdating = False
Cells.Interior.ColorIndex = xlNone
If Target.Columns.Count = 1 Then
Target.EntireColumn.Interior.ColorIndex = 6
End If
End Sub
however, the table I have contains multiple styles of formatting - for example:
cell 1A contains text in bold
cell 1B contains a date and has blue highlighting (cell fill)
cell 1C contains numbers and text - and the letters are coloured in red.
And when I use the code it deletes all the formatting. what I would like is an amendment to the code so that it does not change the formatting. for example when I click on row 1 then the whole row is highlighted in yellow even cell 1B. but as soon as I click on row 2 then all of row 2 is highlighted in yellow and row 1 reverts back to the formatting it originally had i.e. cell 1B will still have cell fill as blue.
Thanks In Advance.
Bookmarks