ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Obtaining sum of bold numbers (https://www.excelbanter.com/excel-discussion-misc-queries/233772-obtaining-sum-bold-numbers.html)

Sum of Bold Numbers[_2_]

Obtaining sum of bold numbers
 
I have got a set of numbers, some of which are bolded, while others are not.

I want to obtain the sum of numbers in bold only without changing the
sequence of data.

Thanks

Jacob Skaria

Obtaining sum of bold numbers
 
You will need to use a User Defined function. If you are new to UDF 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.

Function SumBold(varRange As Range)
Dim varCell As Range
For Each varCell In varRange
If varCell.Font.Bold = True Then
If IsNumeric(varCell) = True Then
SumBold = SumBold + varCell.Value
End If
End If
Next
End Function

The below formula should give you the sum of cells in bold. Please note that
the value will not change if you bold any new cell or change the font to
normal. The formula would require recalculation..for any changes....
=Sumbold(A1:A10)

If this post helps click Yes
---------------
Jacob Skaria


"Sum of Bold Numbers" wrote:

I have got a set of numbers, some of which are bolded, while others are not.

I want to obtain the sum of numbers in bold only without changing the
sequence of data.

Thanks



All times are GMT +1. The time now is 03:14 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com