Count a list of cells with the same background color

后端 未结 5 1281
时光取名叫无心
时光取名叫无心 2020-12-19 01:22

Each cell contains some text and a background color. So I have some cells that are blue and some that are red. What function do I use to count the number of red cells?

5条回答
  •  佛祖请我去吃肉
    2020-12-19 02:09

    Yes VBA is the way to go.

    But, if you don't need to have a cell with formula that auto-counts/updates the number of cells with a particular colour, an alternative is simply to use the 'Find and Replace' function and format the cell to have the appropriate colour fill.

    Hitting 'Find All' will give you the total number of cells found at the bottom left of the dialogue box.

    This becomes especially useful if your search range is massive. The VBA script will be very slow but the 'Find and Replace' function will still be very quick.

提交回复
热议问题