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
Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
Added this time only
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel Tips & Solutions, free examples and tutorials why not check out my downloads
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
I don't think that you can format the text in a message box,maybe design a userform
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel Tips & Solutions, free examples and tutorials why not check out my downloads
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
You can change it in Control Panel to a fixed-pitch font, but it will effect other applications as well.
I agree with Roy -- make a simple userform.
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks