PDA

View Full Version : Highlight some of the cells in a row



Southernwave
10-18-2016, 02:57 AM
I have a worksheet that covers columns (for example) b to f

I want a row to be highlighted when ever I select a cell in that row.

I currently us
.EntireRow.Interior.ColorIndex = 8 but that selected all the row (!).... but I only want b to f

Ant suggestions how I do it ?

MickG
10-18-2016, 03:47 AM
Try:-


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells(Target.Row, "B").Resize(, 5).Interior.ColorIndex = 8
End Sub

Southernwave
10-18-2016, 11:43 AM
Hi Mick ... works perfectly ... many thanks

Andrew

MickG
10-19-2016, 03:55 AM
You're welcome