Thread: Summation
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Frank Kabel Frank Kabel is offline
external usenet poster
 
Posts: 3,885
Default Summation

Hi
try the following user defined function

public Function Sum_Bold(rng as range)
Dim ret_value
Dim cell as range
For each cell in rng
If cell.font.bold then
If IsNumeric(cell.value) then
ret_value = ret_value + cell.value
end if
end if
next
Sum_Bold = ret_value
end Function

Now use this function like
=SUM_BOLD(A1:A30)


--
Regards
Frank Kabel
Frankfurt, Germany


wrote:
Is there a way to total all the rows that are highlighted
bold above a particular cell? I would like to do this with
a VBA macro. The rows that are highlighted bold change
often so the macro needs to be able to sort through and
total the cells that are bold.

Thank You,