How to highlight a row in a listview?

Highlight a row

  • I found you so helpful last time that i have decided to bug you again i'm afraid. I want to click on a cell and have it automatically highlight the entire row. I have found a couple of codes on the internet that do a similar thing (highlight the row upto the cell your in and column) but basically i just want a code that essentially does Shft + Space for me whenever i click in a cell. if it were to highlight it in yellow then when i click out it goes back to normal that would be ideal. Kind Robert

  • Answer:

    Robert Put this in the code for the worksheet you want. It will change the active row to be yellow. Private Sub Worksheet_SelectionChange(ByVal Target As Range) 'highlight active row Static OldRange As Range On Error Resume Next Target.EntireRow.Interior.ColorIndex = 6 OldRange.EntireRow.Interior.ColorIndex = xlColorIndexNone Set OldRange = Target End Sub

Miningco.com Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.