B
Brian
Thank you very much for anserwing my bold function question
but I get a #value error when I try it. Sometime it takes
me to the VB part and highlightes the .rng in the If
rng.Areas.Count Line.
The actual cells I'm using are d23:d27. What am I doing
wrong?
Following is my previous post and your reply-
Hi
you need VBA for this. Try the following
=SUMPRODUCT(--(BoldIndex(A1:A5)),A1:A5)
to sum all bold cells within the range A1:A5
Adapt this to your requirements
'---------------------------------------------------------------------
Function BoldIndex(rng As Range) As Variant
'---------------------------------------------------------------------
Dim cell As Range, row As Range
Dim ret_Bold
If rng.Areas.Count > 1 Then
BoldIndex = CVErr(xlErrValue)
Exit Function
End If
For each cell in rng
if cell.font.bold then
ret_Bold = ret_Bold + 1
end if
next
BoldIndex = ret_Bold
End Function
--
Regards
Frank Kabel
Frankfurt, Germany
Newsbeitrag
..
but I get a #value error when I try it. Sometime it takes
me to the VB part and highlightes the .rng in the If
rng.Areas.Count Line.
The actual cells I'm using are d23:d27. What am I doing
wrong?
Following is my previous post and your reply-
Hi
you need VBA for this. Try the following
=SUMPRODUCT(--(BoldIndex(A1:A5)),A1:A5)
to sum all bold cells within the range A1:A5
Adapt this to your requirements
'---------------------------------------------------------------------
Function BoldIndex(rng As Range) As Variant
'---------------------------------------------------------------------
Dim cell As Range, row As Range
Dim ret_Bold
If rng.Areas.Count > 1 Then
BoldIndex = CVErr(xlErrValue)
Exit Function
End If
For each cell in rng
if cell.font.bold then
ret_Bold = ret_Bold + 1
end if
next
BoldIndex = ret_Bold
End Function
--
Regards
Frank Kabel
Frankfurt, Germany
Newsbeitrag
Hello,
What formula would i use to add for example a1:a5, but to
only add together cells with a number that is bold? Would
it be sumformat? I've tried but I just can't seem to get it.
I'm using excel 2003.
Thanks
Brian
..