+ Reply to Thread
Results 1 to 2 of 2

Formatting data in Msg

  1. #1
    Registered User
    Join Date
    05-04-2005
    Location
    Papamoa, New Zealand
    MS-Off Ver
    Office 365
    Posts
    56

    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

  2. #2
    Registered User
    Join Date
    05-04-2005
    Location
    Papamoa, New Zealand
    MS-Off Ver
    Office 365
    Posts
    56

    Formatting data in Msg

    After playing around myself I found the solution.

    I had

    Dim As Integer

    Changed to

    Dim As Currency

    Thanks anyway.

    Cheers,
    Bernz

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1