Anna,
Here is a variant of the ColorIndex solution. Again, you use SUMPRODUCT to
count or sum
Count: =SUMPRODUCT(--(boldrange(A1:A3)))
Sum: =SUMPRODUCT(--(boldrange(A1:A3)),A1:A3)
'---------------------------------------------------------------------
Function BoldRange(rng As Range) As Variant
'---------------------------------------------------------------------
Dim cell As Range, row As Range
Dim i As Long, j As Long
Dim iWhite As Long, iBlack As Long
Dim aryBold As Variant
If rng.Areas.Count > 1 Then
BoldRange = CVErr(xlErrValue)
Exit Function
End If
If rng.Cells.Count = 1 Then
Set BoldRange = rng
Else
aryBold = rng.Value
i = 0
For Each row In rng.Rows
i = i + 1
j = 0
For Each cell In row.Cells
j = j + 1
aryBold(i, j) = cell.Font.Bold
Next cell
Next row
End If
BoldRange = aryBold
End Function
--
HTH
Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
Anna said:
Hi!
Thank you so much guys! It really helped alot!
Is there anyway I can do the same thing, but instead of summarizing all
the numbers with a specific cell color I summarize the numbers written with
bold text?