Cell color
Closed
Doc1772
-
Mar 24, 2015 at 11:39 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Mar 24, 2015 at 12:16 PM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Mar 24, 2015 at 12:16 PM
Related:
- Cell color
- Notepad++ change background color - Guide
- Rg45 color coding - Guide
- Sound card color code - Guide
- Html text color - Guide
- Powertoys color picker download - Download - Other
1 response
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
552
Mar 24, 2015 at 12:16 PM
Mar 24, 2015 at 12:16 PM
Hi Doc,
The following code will look in column A for green and yellow filled cells.
The values of the green filled cells will be added and the result will be placed in B1. The result for the yellow filled cells will be placed in B2.
Here is the code:
Best regards,
Trowa
The following code will look in column A for green and yellow filled cells.
The values of the green filled cells will be added and the result will be placed in B1. The result for the yellow filled cells will be placed in B2.
Here is the code:
Sub RunMe() Dim lRow As Integer Dim GreenCount, YellowCount As Long lRow = Range("A" & Rows.Count).End(xlUp).Row For Each cell In Range("A1:A" & lRow) If cell.Interior.Color = 5287936 Then GreenCount = GreenCount + cell.Value If cell.Interior.Color = 65535 Then YellowCount = YellowCount + cell.Value Next cell Range("B1").Value = GreenCount Range("B2").Value = YellowCount End Sub
Best regards,
Trowa