[PA] 업무자동화/[XL]Excel & VBA

색깔 있는 셀 개수 세기

Weneedu 2022. 4. 8. 01:29

20220407 1227 

 

REF

[1] "https://www.howtoexcel.org/count-colored-cells/"

 

code

Function zColorCellCount(zTarget, zRefCell_with_color)

zcol = zRefCell_with_color.Interior.ColorIndex
zcounter = 0
For Each c In zTarget
  If c.Interior.ColorIndex = zcol Then
      zcounter = zcounter + 1
  End If
Next c
zColorCellCount = zcounter

End Function
저작자표시 (새창열림)