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
Bookmarks