Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Display Value in 'Currency Format'


How can I make frmstat.lblCOH.caption display Capital_on_Hold with $ and
, instead of just the raw number?

Dim Capital_on_Hold As Currency

'Find the last row of data on CORE ON-HOLD sheet
Finalrow =
Sheets(frmBrain.txtCoreonhold.Text).Range("A65536" ).End(xlUp).Row
Capital_on_Hold = 0

For x = 2 To Finalrow
Capital_on_Hold = Capital_on_Hold +
Val(Trim(Sheets(frmBrain.txtCoreonhold.Text).Range ("N" & x).Formula))
Next x
frmStats.lblCOH.Caption = Capital_on_Hold

frmStats.Show


--
mpeplow
------------------------------------------------------------------------
mpeplow's Profile: http://www.excelforum.com/member.php...o&userid=34812
View this thread: http://www.excelforum.com/showthread...hreadid=551944

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Display Value in 'Currency Format'


frmStats.lblCOH.Caption = Format(Capital_on_Hold, "$#,##0.00")

HTH,
Bernie
MS Excel MVP


"mpeplow" wrote in message
...

How can I make frmstat.lblCOH.caption display Capital_on_Hold with $ and
, instead of just the raw number?

Dim Capital_on_Hold As Currency

'Find the last row of data on CORE ON-HOLD sheet
Finalrow =
Sheets(frmBrain.txtCoreonhold.Text).Range("A65536" ).End(xlUp).Row
Capital_on_Hold = 0

For x = 2 To Finalrow
Capital_on_Hold = Capital_on_Hold +
Val(Trim(Sheets(frmBrain.txtCoreonhold.Text).Range ("N" & x).Formula))
Next x
frmStats.lblCOH.Caption = Capital_on_Hold

frmStats.Show


--
mpeplow
------------------------------------------------------------------------
mpeplow's Profile: http://www.excelforum.com/member.php...o&userid=34812
View this thread: http://www.excelforum.com/showthread...hreadid=551944



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Display Value in 'Currency Format'


I get wrong number of arguments or invalid property assignment? Any
idea why? Do I need to Dim as String?


--
mpeplow
------------------------------------------------------------------------
mpeplow's Profile: http://www.excelforum.com/member.php...o&userid=34812
View this thread: http://www.excelforum.com/showthread...hreadid=551944

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Display Value in 'Currency Format'

This worked fine for me....

Private Sub CommandButton1_Click()
Dim Capital_on_Hold As Currency
Capital_on_Hold = 1234.567
UserForm1.Label1.Caption = Format(Capital_on_Hold, "$#,##0.00")
End Sub

It may be that your newsreader inserted invalid characters...?

HTH,
Bernie
MS Excel MVP


"mpeplow" wrote in message
...

I get wrong number of arguments or invalid property assignment? Any
idea why? Do I need to Dim as String?


--
mpeplow
------------------------------------------------------------------------
mpeplow's Profile: http://www.excelforum.com/member.php...o&userid=34812
View this thread: http://www.excelforum.com/showthread...hreadid=551944



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 to add new currency Symbol in Format/Cell/Currency NOORZAD Excel Discussion (Misc queries) 2 June 22nd 09 07:59 AM
How can I display a loss or gain (currency) brewster56 Excel Worksheet Functions 5 November 26th 08 07:41 PM
Default display format for "currency" data type Cynthia Excel Discussion (Misc queries) 1 June 29th 07 01:12 PM
Failure to display currency format SWAN_943 Excel Discussion (Misc queries) 2 October 2nd 05 03:00 PM
Conversion from currency value to currency text format Frank Kabel Excel Programming 1 August 18th 04 10:06 PM


All times are GMT +1. The time now is 04:23 PM.

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"