Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Need Text box value to be $5,000.00 not 5000

I have the following code
Sub CalcPrice()

Dim TotalPrice As Currency
Set xls = Excel.Worksheets("ProjectDB")
Sheets("ProjectDB").Select

Col = 11
For row = 141 To 160
Price = xls.Cells(row, Col)
TotalPrice = TotalPrice + Price
Next row
QuoteForm.TBPricing.Value = TotalPrice
End Sub
I want the sum of these cell displayed as currency and not just a number
Please help. Thank You
--
Jason V
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default Need Text box value to be $5,000.00 not 5000

QuoteForm.TBPricing.Value = Format(TotalPrice,"$#,##0.00")

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"Jason V" wrote in message
...
I have the following code
Sub CalcPrice()

Dim TotalPrice As Currency
Set xls = Excel.Worksheets("ProjectDB")
Sheets("ProjectDB").Select

Col = 11
For row = 141 To 160
Price = xls.Cells(row, Col)
TotalPrice = TotalPrice + Price
Next row
QuoteForm.TBPricing.Value = TotalPrice
End Sub
I want the sum of these cell displayed as currency and not just a number
Please help. Thank You
--
Jason V



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default Need Text box value to be $5,000.00 not 5000

On 28 Dec., 18:41, Jason V wrote:
I have the following code
Sub CalcPrice()

Dim TotalPrice As Currency
Set xls = Excel.Worksheets("ProjectDB")
Sheets("ProjectDB").Select

Col = 11
For row = 141 To 160
* * Price = xls.Cells(row, Col)
* * TotalPrice = TotalPrice + Price
Next row
QuoteForm.TBPricing.Value = TotalPrice
End Sub
I want the sum of these cell displayed as currency and not just a number
Please help. Thank You
--
Jason V


Hi Jason

QuoteForm.TBPricing.Value = FormatCurrency(TotalPrice)

Regards,

Per
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Need Text box value to be $5,000.00 not 5000

Thank You. It works.
--
Jason V


"Per Jessen" wrote:

On 28 Dec., 18:41, Jason V wrote:
I have the following code
Sub CalcPrice()

Dim TotalPrice As Currency
Set xls = Excel.Worksheets("ProjectDB")
Sheets("ProjectDB").Select

Col = 11
For row = 141 To 160
Price = xls.Cells(row, Col)
TotalPrice = TotalPrice + Price
Next row
QuoteForm.TBPricing.Value = TotalPrice
End Sub
I want the sum of these cell displayed as currency and not just a number
Please help. Thank You
--
Jason V


Hi Jason

QuoteForm.TBPricing.Value = FormatCurrency(TotalPrice)

Regards,

Per

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
HOW CAN CONVERT A NUMBER INTO TEXT E.G. 5000 TO FIVE THOUSAND Sachin Excel Discussion (Misc queries) 1 May 29th 09 07:30 AM
How do I add a zero in front of a text formatt number of 5000 reco p210driver Excel Worksheet Functions 0 November 13th 06 11:26 PM
Round to nearest 5000? Kim Excel Worksheet Functions 2 August 8th 06 02:16 AM
Round to nearest 5000 Woody13 Excel Discussion (Misc queries) 4 July 7th 06 09:34 PM
Displaying 5000 Andrea Excel Discussion (Misc queries) 3 January 30th 06 05:48 PM


All times are GMT +1. The time now is 10:53 AM.

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

About Us

"It's about Microsoft Excel"