LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 477
Default Format Function Output to numeric (#,###.00)

The following UDF works great except it rounds to $1,234.00 versus $1,234.56.
How can I get the pennies to show?

Function SumByColor(CellColor As Integer, SumRange As Range) As Long
Dim MyCell As Range
Dim myTotal As Double
For Each MyCell In SumRange
If MyCell.Interior.ColorIndex = CellColor Then
myTotal = WorksheetFunction.Sum(MyCell) + myTotal
End If
Next MyCell
SumByColor = myTotal
End Function
 
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
VBA - Function Output Jeff Excel Discussion (Misc queries) 2 March 30th 07 07:53 PM
Combo Box - format output as time Robert Mark Bram Excel Discussion (Misc queries) 1 December 5th 05 12:30 AM
Change number (in text format) to numeric format Pam Excel Discussion (Misc queries) 5 October 24th 05 07:45 PM
format cell from data input to output form Brad Stevenson Excel Worksheet Functions 2 May 19th 05 06:04 PM
HOW CAN I SHOW OUTPUT IN FEET INCH FORMAT rich New Users to Excel 2 May 8th 05 06:01 AM


All times are GMT +1. The time now is 02:10 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"