Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,564
- Office Version
- 365
- 2016
- Platform
- Windows
Is this an appropriate way of counting how many cells in a range have a fill colour of (custom variable) "ccgreen"?
This method, possibly useless, is giving me a value of 0, when it would be clearly higher (testing has 8 green cells filled).
VBA Code:
With ws_form
rwend = Application.WorksheetFunction.Match("end", .Columns(8), 0) - 1
Set rngseg = .Range("H9:H" & rwend)
cntata = Application.WorksheetFunction.CountIf(rngseg, .Cells.Interior.Color = ccgreen)
End with
This method, possibly useless, is giving me a value of 0, when it would be clearly higher (testing has 8 green cells filled).