Sumifsbold

williamssj127

New Member
Joined
May 28, 2017
Messages
2
Hi! I have used VBA to create a sumbold formula in a sales excel sheet i have.

Basically i have a list of all revenue likely to book this week, which is manually made bold whenever something is booked.

I have used the sumbold to work out break downs of whats been booked, however i would also like to be able to break this down by product sold EG SumBold (Range, Criteria, numbers to sum) Sort of like a sumifs BUT only to count the numbers in bold.

Can anyone help with this?
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Hi,

You have already created your UDF ...

Why don't you post it ... for the little modification to insert your new conditions ...
 
Upvote 0
Hi,

You have already created your UDF ...

Why don't you post it ... for the little modification to insert your new conditions ...


Hey,

See below - I actually didn't create this myself, someone helped me. This is it currently:

Public Function SumBold(rngSumRange As Range) As Single
Application.Volatile
Dim rngCell As Range
For Each rngCell In rngSumRange
If IsNumeric(rngCell.Value) Then
If rngCell.Font.Bold = True Then
SumBold = SumBold + rngCell.Value
End If
End If
Next rngCell
End Function

Thanks!
 
Upvote 0
Hello,

Can you explain specifically the conditions you need to add ...?
 
Upvote 0
Assuming all of the bold numbers you will ever want to count are constants (that is, none of the bold number cells will ever have a formula in them)...
Code:
[table="width: 500"]
[tr]
	[td]Function BoldNumberCount(Rng As Range) As Long
  Dim Cell As Range
  For Each Cell In Rng.SpecialCells(xlConstants, xlNumbers)
    If Cell.Font.Bold Then BoldNumberCount = BoldNumberCount + 1
  Next
End Function[/td]
[/tr]
[/table]
 
Upvote 0

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,632
Latest member
jladair

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top