Conditional Formatting cell in Multiple Sheets

  • 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.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!