Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
mikeburg
 
Posts: n/a
Default Sum total bolded figures in a column


I am trying to come up with a simple cell formula to total or sum
amounts bolded in a column.

Any Ideas?

Thanks from a person needing help.

mikeburg


--
mikeburg
------------------------------------------------------------------------
mikeburg's Profile: http://www.excelforum.com/member.php...o&userid=24581
View this thread: http://www.excelforum.com/showthread...hreadid=392229

  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

There's nothing built into excel that will sum values based on formatting.

You could use a User defined function, though.

Option Explicit
Function SumBold(rng As Range)

Application.Volatile

Dim myCell As Range
Dim myTotal As Double

myTotal = 0
For Each myCell In rng.Cells
With myCell
If .Font.Bold = True Then
If IsNumeric(.Value) Then
myTotal = myTotal + .Value
End If
End If
End With
Next myCell

SumBold = myTotal

End Function

Be aware that changing formats won't cause excel to recalculate. You could be
one calculation cycle behind. I'd hit the calculate key (F9) before I trusted
the value in the cell.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Short course:

Open your workbook.
Hit alt-f11 to get to the VBE (where macros/UDF's live)
hit ctrl-R to view the project explorer
Find your workbook.
should look like: VBAProject (yourfilename.xls)

right click on the project name
Insert, then Module
You should see the code window pop up on the right hand side

Paste the code in there.

Now go back to excel.
Into a test cell and type:
=sumbold(a1:a10)

You didn't ask, but Chip Pearson has similar routines based on colors. You may
want to look at that, too:

http://www.cpearson.com/excel/colors.htm



mikeburg wrote:

I am trying to come up with a simple cell formula to total or sum
amounts bolded in a column.

Any Ideas?

Thanks from a person needing help.

mikeburg

--
mikeburg
------------------------------------------------------------------------
mikeburg's Profile: http://www.excelforum.com/member.php...o&userid=24581
View this thread: http://www.excelforum.com/showthread...hreadid=392229


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
In excel - how to total column if am not sure of the last cell PFHMoney New Users to Excel 4 May 27th 05 01:27 PM
Adding the sum of figures in one column if they meet 2 criteria Justine Burn via OfficeKB.com Excel Worksheet Functions 4 February 22nd 05 02:36 AM
If column A and column B have values how do i get the total in co. reness Excel Discussion (Misc queries) 1 January 9th 05 11:38 PM
calculate which cells in column A will give me the total of column Ken Excel Worksheet Functions 4 January 6th 05 06:25 AM
add column of minutes, show total in hours & minutes glider pilot Excel Worksheet Functions 1 December 30th 04 10:27 PM


All times are GMT +1. The time now is 12:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"