Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Excel: Can I fill a color in the entire row if the condition is met in one cell?

I need to fill a color in an entire row when a simple condition is met in one cell. Is it possible in MS Excel?

5 Answers

Relevance
  • Anonymous
    1 decade ago
    Favorite Answer

    Yes,

    As mentioned above, select the entire row then click conditonal formatting and select in the cell value is drop box, "formula is" and then enter the formula for example, =a$4$=30

    Best regards

    Kumar

  • 1 decade ago

    Yes.

    You need to write some VBA code and execute the macro to run it.

    In my example sheet I'm going to tell Excel to highlight Row 1 with the color of yellow if I type the word "yes" in cell A2. In other words, typing "yes" in A2 is the condition that must be met in order for the row to color in yellow.

    This is the vba code:

    Sub Macro1()

    Range("A2").Select

    If ActiveCell.FormulaR1C1 = "yes" Then

    Rows("1:1").Select

    With Selection.Interior

    .Pattern = xlSolid

    .PatternColorIndex = xlAutomatic

    .Color = 65535

    .TintAndShade = 0

    .PatternTintAndShade = 0

    End With

    End If

    End Sub

    Then when I type "yes" in the cell, I can execute my macro, and the row turns yellow. View, View macros, click the macro, and then click run.

    You can further add a button to the macro if you like where you can click the button to execute. Or you could add this entire code to the worksheet_selectionchange event if you like. I didn't do either of these here because i wasn't sure how far you wanted to get into the VBA language. But this gives you the basics of how to do it.

    Note: this was done using Excel 2007.

  • Joe
    Lv 5
    1 decade ago

    select the row, and apply conditional formatting to the entire row.

  • 4 years ago

    click on the cellular row type. each and every row has its corresponding type on the appropriate of the spreadsheet, only click on the type as quickly as, and the full row would be highlighted. they you may opt for the colour you desire to fill it in with.

  • How do you think about the answers? You can sign in to vote the answer.
  • 1 decade ago

    You don't need any VB code for something this simple... follow Kumar's advice above. Easy thing to do.

Still have questions? Get your answers by asking now.