Results 1 to 4 of 4

How do I format the text in a message box?

Threaded View

etindell How do I format the text in a... 04-26-2010, 03:12 PM
royUK Re: How do I format the text... 04-26-2010, 03:16 PM
royUK Re: How do I format the text... 04-26-2010, 03:18 PM
shg Re: How do I format the text... 04-26-2010, 04:15 PM
  1. #1
    Registered User
    Join Date
    04-26-2010
    Location
    Houston, TX
    MS-Off Ver
    Excel 2003
    Posts
    1

    Red face How do I format the text in a message box?

    The code below builds a message string that is then feed to a message box if it contains information on an error. The message string is a dynamic list of units and the number of missing months of data each has in a SQL based data download. Everything works except the column of the number of missing months of data does not line up. I suspect there is nothing wrong with my logic, I just need to switch the text in the message box to a non-proportionally spaced font or use some other technique to get it to line up. I'm brain dead at this point. Help!
    ' Create data integrity check results message.
        dblRow = 6
        strDICResults = "The following units are missing data." & vbCrLf & vbCrLf & "Unit           Months Of Missing Data" & vbCrLf
        With Worksheets("Input")
            Do
                If .Cells(dblRow, 9).Value <> 0 Then
                    strDICResults = strDICResults _
                        & vbCrLf _
                        & .Cells(dblRow, 4).Value _
                        & String(25 - Len(.Cells(dblRow, 4).Value), ".") _
                        & .Cells(dblRow, 9).Value
                End If
                dblRow = dblRow + 1
            Loop While Len(.Cells(dblRow, 4).Value) > 0
        End With
        strDICResults = strDICResults & vbCrLf & vbCrLf & "Do you wish to proceed anyway?"
        
        ' Display data integrity check results message.
        If Len(strDICResults) > 77 Then
            vntResponse = MsgBox(strDICResults, vbYesNo + vbCritical, "Error Message")
        End If
        If vntResponse = 7 Then GoTo Errorhandler1a
    Last edited by royUK; 04-26-2010 at 03:16 PM. Reason: add code tags

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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