Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to add new currency Symbol in Format/Cell/Currency | Excel Discussion (Misc queries) | |||
How can I display a loss or gain (currency) | Excel Worksheet Functions | |||
Default display format for "currency" data type | Excel Discussion (Misc queries) | |||
Failure to display currency format | Excel Discussion (Misc queries) | |||
Conversion from currency value to currency text format | Excel Programming |