Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Obtaining Sum of Data in Bold Font
I have a set of numbers, some of which are in bold font and others are not.
I want to obtain the sum of the items in bold only, without distotorting the original data. Is there a way to do this? |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Obtaining Sum of Data in Bold Font
Try the below UDF
Suppose the range to be totalled is A1:A10; use the formula =AddIfBold(C7:C16) Function AddIfBold(varRange As Range) As Double For Each cell In varRange If cell.Font.Bold Then AddIfBold = AddIfBold + cell.Value Next End Function If you are new to VBA; set the Security level to low/medium in (Tools|Macro|Security). From workbook launch VBE using short-key Alt+F11. From menu 'Insert' a module and paste the below code. Save. Get back to Workbook. If this post helps click Yes --------------- Jacob Skaria "Sum of Bold Numbers" wrote: I have a set of numbers, some of which are in bold font and others are not. I want to obtain the sum of the items in bold only, without distotorting the original data. Is there a way to do this? |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Obtaining Sum of Data in Bold Font
Hi,
Try this UDF. Alt+F11 to open VB editor. Right click 'ThisWorkbook" and insert module and paste the code below in. Call with =SumBold(A26:G26) Public Function SumBold(Rng As Range) As Long For Each c In Rng If IsNumeric(c.Value) And c.Font.Bold = True Then SumBold = SumBold + c.Value End If Next c End Function Mike "Sum of Bold Numbers" wrote: I have a set of numbers, some of which are in bold font and others are not. I want to obtain the sum of the items in bold only, without distotorting the original data. Is there a way to do this? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Bold font if statement | Excel Worksheet Functions | |||
Bold Font question | Excel Discussion (Misc queries) | |||
Bold Font question | Excel Discussion (Misc queries) | |||
Bold font for Location Totals | Excel Discussion (Misc queries) | |||
How to show only bold font ? | Excel Worksheet Functions |