VBA/Code
[VBA] ColorCount
A
2019. 12. 16. 07:00
반응형
Basic 파일 다운로드
함수 사용방법
VBA Code
Function ColorCount(countRange As range, colorRange As range, Optional colorType As Boolean = False) As Long
Application.Volatile True
On Error Resume Next
Dim rng As range, result As Double
If colorType Then
For Each rng In countRange
If rng.Font.Color = colorRange.Font.Color Then result = result + 1
Next rng
Else
For Each rng In countRange
If rng.Interior.Color = colorRange.Interior.Color Then result = result + 1
Next rng
End If
ColorCount = result
End Function
유사 함수
반응형