Message box to return curency with $ and comma's intact

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Below is an example of code I have entered. The return is returning correctly
but the cell referenced is not returning with a $ or commas. I can formatted
the cell correctly and I have tried multiple methods includeing Dim x as
curreny with X = Range("D13").Value

If someone can tell me what i am missing I would appreciate it greatly.
Thank you for your help

Private Sub CommandButton2_Click()
If CommandButton1.Value = "Rate Card Regular" Or CommandButton1.Value =
"Rate Card Complex" Or CommandButton1.Value = "Rate Card Regular Rush" Or
CommandButton1.Value = "Rate Card Complex Rush" Then
MsgBox "Rate Card Amount Used = & Range("D13").Value, vbInformation
End If
 
Hi Ed

one option is to do this:

MsgBox "Rate Card Amount Used = " & Format(Range("D13"), "$#,###.00"),
vbInformation

(note you're also missing a space & " after the =)

Cheers
JulieD
 
Hi, I think that the following will work for you
X = Format(Range("D13").Value, "$#,##0.00")

HTH--Lonnie M.
 
Use the text property to see the cell as it is displayed.

Private Sub CommandButton2_Click()
If CommandButton1.Value = "Rate Card Regular" Or CommandButton1.Value =
"Rate Card Complex" Or CommandButton1.Value = "Rate Card Regular Rush" Or
CommandButton1.Value = "Rate Card Complex Rush" Then
MsgBox "Rate Card Amount Used = & Range("D13").Text, vbInformation
End If
 
or maybe

Private Sub CommandButton2_Click()
If CommandButton1.Value = "Rate Card Regular" Or CommandButton1.Value =
"Rate Card Complex" Or CommandButton1.Value = "Rate Card Regular Rush" Or
CommandButton1.Value = "Rate Card Complex Rush" Then
MsgBox "Rate Card Amount Used = " & Range("D13").Text, vbInformation
End If

--

HTH

RP
(remove nothere from the email address if mailing direct)
 

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