Questions

Answer for:

if statement microsoft excel- if column a has bold text then sum column c

Message 2 of 8

View entire thread
+
1 Votes
smuzoen

If there is some condition that makes the cells bold then perhaps you could use formulas however if the cells are manually made bold you are stuck using a UDF. In a module place the following code
[pre]
Function sumBoldCells(sumRng As Range) As Double

Dim ifBold As Range
For Each ifBold In sumRng
If ifBold.Offset(, -2).Font.Bold = True Then
sumBoldCells = sumBoldCells + ifBold
End If
Next
End Function
[/pre]
Then to use the formula-> =sumBoldCells(C1:C45)