Display Value in 'Currency Format'

  • Thread starter Thread starter mpeplow
  • Start date Start date
M

mpeplow

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
 
frmStats.lblCOH.Caption = Format(Capital_on_Hold, "$#,##0.00")

HTH,
Bernie
MS Excel MVP
 
I get wrong number of arguments or invalid property assignment? Any
idea why? Do I need to Dim as String?
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top