View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Display decimals in a msgbox

Sub formatmsgbox()
vamp = ActiveCell
MsgBox "There is a difference of " & Format(vamp, "#,###.00")
End Sub

--
Don Guillett
SalesAid Software

"JT" wrote in message
...
If certain conditions are met, a message is displayed to the user with the
following code"

MsgBox ("There is a difference of " & " (" & vamt & ") " & " for " &
vWorker, vbCritical, "Amount Difference"

The issue I would like to display the variable vamt as 5.00 or 5.10 or
5.12;
whatever the amount is in the message box.

If the amount is 5.00, it is being displayed as (5) in the msgbox. In the
spreadsheet where the amount comes from, it is displayed as 5.00 in the
Excel
spreadsheet but the amount in the formula bar is 5.

Is there a way to format this variable to 2 decimals places so it is
dispalyed as 5.00 in the msgbox?

Thanks for the help. Any ideas or suggestions are greatly appreciated.
--
JT