Conditional Formatting cell in Multiple Sheets

  • There are multiple files as sample file attached in a given folder.

    In the following attached file ,Column F, following Conditional formatting required;

    • Green Color filled to be removed,
    • Cell with value BUY to be filled in Green and font color Red
    • Cell with value SELL to be filled in Red and font color White
    • The blank cell should have no color

    Please

  • Manually remove the green colour in column F if it exists. Then select all the cells with data in column F and create two conditional formatting rules using the following two formulae:


    =F2="BUY" ---- select Green for fill format and Red in font colour format

    =F2="SELL" ---- select Red for fill format and White in font colour format

    You can say "THANK YOU" for help received by clicking the :thumbup: icon in the bottom right corner of the helper's post.
    Practice makes perfect. I am very far from perfect so I'm still practising.

  • Manually remove the green colour in column F if it exists. Then select all the cells with data in column F and create two conditional formatting rules using the following two formulae:


    =F2="BUY" ---- select Green for fill format and Red in font colour format

    =F2="SELL" ---- select Red for fill format and White in font colour format

    Thanks Mumps for your advise, but as I mentioned there are multiple files in the given folder and all the files require the same formatting.

    I need a VBA code to format all the files at one go.

  • Place this macro in a separate workbook. The macro assumes that the sheet to be formatted will always be the first sheet in each workbook. Change the folder path (in red) to suit your needs.

    You can say "THANK YOU" for help received by clicking the :thumbup: icon in the bottom right corner of the helper's post.
    Practice makes perfect. I am very far from perfect so I'm still practising.

  • Place this macro in a separate workbook. The macro assumes that the sheet to be formatted will always be the first sheet in each workbook. Change the folder path (in red) to suit your needs.

    Thanks Mumps,

    Its working perfectly.

    But only one thing. It is not able to remove previous formatting of cells filled in Green color.

  • Try:

    You can say "THANK YOU" for help received by clicking the :thumbup: icon in the bottom right corner of the helper's post.
    Practice makes perfect. I am very far from perfect so I'm still practising.

  • Try:

    Perfect.

    Job Done.

    You are Great Mumps

    :*:thumbup::thumbup:

  • My pleasure. :)

    You can say "THANK YOU" for help received by clicking the :thumbup: icon in the bottom right corner of the helper's post.
    Practice makes perfect. I am very far from perfect so I'm still practising.