View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
BernzG[_18_] BernzG[_18_] is offline
external usenet poster
 
Posts: 1
Default Formatting data in Msg


Hi,

Have the error message working okay but the result is always rounded to
whole dollars.

Tills, bank and variance refer to named fields within the spreadsheet.

e.g. tills = Sheets("Tempdata").Range("Tilltotal").Value


Code for error message itself :

'Building the VARIANCE error message
Msg = "TILLS total :" & vbTab & Format(tills, "$##,##0.00")
Msg = Msg & vbCrLf & "BANK total :" & vbTab & Format(bank,
"$##,##0.00")
Msg = Msg & vbCrLf & vbCrLf & " "
Msg = Msg & vbCrLf & "Variance :" & vbTab & Format(variance,
"$##,##0.00")
Msg = Msg & vbCrLf & vbCrLf & " "
Msg = Msg & vbCrLf & "Do you wish to proceed and SAVE the amounts
entered?"

'Display the result and prompt for 'proceed' or 'review' amounts
Answer = MsgBox(Msg, vbYesNo, "Takings Validation")
If Answer = vbYes Then
GoTo ValidData

Cheers,
Bernz


--
BernzG
------------------------------------------------------------------------
BernzG's Profile: http://www.excelforum.com/member.php...o&userid=22949
View this thread: http://www.excelforum.com/showthread...hreadid=465760