Merhabalar;
Asagida verilmis olan fonksiyon koduna renk kontrolu eklemek istiyorum. bunu nasil yaparim? Mesela sozkonusu sayim sonucunun yalnizca kirmizi renkteki sekilleri icermesi icin fonksiyon tanimina nasil bir ekleme yapmaliyiz?
Tesekkur ederim.
Asagida verilmis olan fonksiyon koduna renk kontrolu eklemek istiyorum. bunu nasil yaparim? Mesela sozkonusu sayim sonucunun yalnizca kirmizi renkteki sekilleri icermesi icin fonksiyon tanimina nasil bir ekleme yapmaliyiz?
Tesekkur ederim.
Kod:
Function Headcount(ShapeType As MsoAutoShapeType, Optional Target As Range) As Long
Dim sh As Worksheet, shp As Shape, cnt As Long
If Target Is Nothing Then
For Each sh In ThisWorkbook.Sheets
For Each shp In sh.Shapes
If shp.Type = ShapeType Then
cnt = cnt + 1
End If
Next
Next
Else
For Each shp In Target.Parent.Shapes
If shp.AutoShapeType = ShapeType Then
If Not Intersect(shp.TopLeftCell, Target) Is Nothing _
And Not Intersect(shp.BottomRightCell, Target) Is Nothing Then
cnt = cnt + 1
End If
End If
Next
End If
Headcount = cnt
End Function