1

I have concatenated text and some basic calculations showing on my MsgBox. How can I get the number to display in currency format? I have placed a dollar sign before the calculations but it would be better if it had the proper currency format with 2 decimals. $1050.00

MsgBox "Total Cost is $" & (QuoteInput * 3 + QuoteInputTwo * 5 + 670), vbOKOnly, "White Glove Service"
FaneDuru
  • 38,298
  • 4
  • 19
  • 27
  • 1
    Why not just use `Format$`? That's what it's for... – braX Dec 30 '20 at 06:53
  • Try this way, please: `MsgBox "Total Cost is " & Format(QuoteInput * 3 + QuoteInputTwo * 5 + 670, "#####.00"), vbOKOnly, "White Glove Service"` – FaneDuru Dec 30 '20 at 07:34
  • @FaneDuru It will not show any dollar sign. – Harun24hr Dec 30 '20 at 08:41
  • @Harun24HR: Yes, I missed the '$' character in the format string. It should be `MsgBox "Total Cost is " & Format(QuoteInput * 3 + QuoteInputTwo * 5 + 670, "$#####.00"), vbOKOnly, "White Glove Service"`... – FaneDuru Dec 30 '20 at 08:44

2 Answers2

0

May be you read all the comments to your question. I am just posting as answer same as comment. Try below and let us know your further feedback.

Sub FormatCurrency()
    MsgBox "Total Cost is " & Format$(QuoteInput * 3 + QuoteInputTwo * 5 + 670, "$#.00"), vbOKOnly, "White Glove Service"
End Sub
Harun24hr
  • 30,391
  • 4
  • 21
  • 36
0

Use Format and the magic format string "Currency" which is exactly for this:

MsgBox "Total Cost is " & Format(QuoteInput * 3 + QuoteInputTwo * 5 + 670, "Currency"), vbOKOnly, "White Glove Service"
Gustav
  • 53,498
  • 7
  • 29
  • 55