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?
 

James006

Well-known Member
Joined
Apr 4, 2009
Messages
3,680
Hi,

You have already created your UDF ...

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

williamssj127

New Member
Joined
May 28, 2017
Messages
2
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!
 

James006

Well-known Member
Joined
Apr 4, 2009
Messages
3,680
Hello,

Can you explain specifically the conditions you need to add ...?
 

Rick Rothstein

MrExcel MVP
Joined
Apr 18, 2011
Messages
35,504
Office Version
2010
Platform
Windows
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]
 

Forum statistics

Threads
1,081,851
Messages
5,361,688
Members
400,648
Latest member
mamamia93

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top