How to highlight a row in a listview?

In Excel is it possible to highlight a row Red if anywhere in that row is clicked?

  • I need to quickly mark a bunch of rows scattered around a large excel file.. Is there a macro code that can be written for this task? Basically if I click anywhere in a row it needs to turn the entire row red.. for each row I click. Then later I can manually sort by color and remove the red rows.

  • Answer:

    Yes. Such macro would have to run freely and continously. Therefore I would put the script directly in the said sheet you would have to use it; Open VBA (Alt+F11) and double click the sheet you wish use this macro... Paste all that is under the ##### in the sheet. The way I wrote it, you would have to start the macro by typing True in the A1 cell... But you can change that. Cells(1, 1) mean cell A1... if you want like C1 put (1, 3) or if you wish A2 put (2, 1)... To start macro simply go to the choosen cell and type true. To stop, return there and clear it or type anything else lol... #### Option Explicit ' ' Macro made by Simonp for Custom S Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Cells(1, 1) = True Then Dim RngRow As Range Dim RngCol As Range Dim RngFinal As Range Dim Row As Long Dim Col As Long Row = Target.Row Col = Target.Column Set RngRow = Range("A" & Row, Target) RngRow.Interior.ColorIndex = 3 End If End Sub

Custom S at Yahoo! Answers Visit the source

Was this solution helpful to you?

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.