magneatooo
New Member
- Joined
- Apr 14, 2021
- Messages
- 1
- Office Version
- 365
- Platform
- Windows
HI all!
Admittedly, I'm terrible at Excel. I keep a spreadsheet for work and color code it. I found a formula via Google to count cells by color with a "key" I made to reference (i.e. I have a cell colored Yellow that said "Waiting for Verification") and then it counts how many are colored the cell in the key I referenced.
I need a way for the page to update -- when I change a cell from Yellow to Red, I need the total to update. Like if I change the cell that says "John Smith" from yellow to red, I need the yellow count to change from 29 to 28, etc. The "key" I made doesn't change.
Sorry if I'm babbling -- again, not very smart with Excel.
This is the code I'm using, which is really great for counting my cell colors. I just need to know what to add or update or whatever to update the counts.
Anything to help I'd be forever grateful -- I'm seriously way in over my head and this is the first macro I've ever done LOL. Thank you!!
Admittedly, I'm terrible at Excel. I keep a spreadsheet for work and color code it. I found a formula via Google to count cells by color with a "key" I made to reference (i.e. I have a cell colored Yellow that said "Waiting for Verification") and then it counts how many are colored the cell in the key I referenced.
I need a way for the page to update -- when I change a cell from Yellow to Red, I need the total to update. Like if I change the cell that says "John Smith" from yellow to red, I need the yellow count to change from 29 to 28, etc. The "key" I made doesn't change.
Sorry if I'm babbling -- again, not very smart with Excel.
This is the code I'm using, which is really great for counting my cell colors. I just need to know what to add or update or whatever to update the counts.
VBA Code:
Function CountCcolor(range_data As Range, criteria As Range) As Long
Dim datax As Range
Dim xcolor As Long
xcolor = criteria.Interior.ColorIndex
For Each datax In range_data
If datax.Interior.ColorIndex = xcolor Then
CountCcolor = CountCcolor + 1
End If
Next datax
End Function
Anything to help I'd be forever grateful -- I'm seriously way in over my head and this is the first macro I've ever done LOL. Thank you!!