VBA for Cell Color Counting

wizardmagu

Board Regular
Joined
Dec 27, 2012
Messages
58
Office Version
  1. 365
Platform
  1. Windows
I have some VBA code (very simple) to count cell color that I found on Youtube. I added the Worksheet and SelectionChange command to update my formula count of cells of a specific color. It seems to work for first few color changes, but then it stops working. I have to go into the formula and hit enter to get it to refresh. I am just curious is someone has any guidance on how to keep the command working.


1667503757004.png
 

Attachments

  • 1667503703463.png
    1667503703463.png
    34.7 KB · Views: 3

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
I pasted that VBA code but keep getting an error. Do i need to change the code from your link to line up with names in my current VBA? This stuff is totally new to me

1667506234546.png




1667506198029.png
 

Attachments

  • 1667506169448.png
    1667506169448.png
    59.6 KB · Views: 2
Upvote 0
There are a number of Count By Color codes out there that do the same thing. The point of my reply was not the code itself, but the explanation as to why your count doesn't update.
It is the nature of the beast. Formula are triggered/recalculated when values change, not formatting.

This is the explanation that I was referring to:
1667506486963.png
 
Upvote 0
I read through it to understand what was said. When I use format painter to paint cells to the target color it updates perfectly. I was just wondering if there was somthing out there that would allow it to update without the need to use format painter.

Thanks for the link
 
Upvote 0

Forum statistics

Threads
1,214,819
Messages
6,121,749
Members
449,050
Latest member
excelknuckles

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top