formatting a msgbox

  • Thread starter Thread starter Ned
  • Start date Start date
N

Ned

A msgbox displays at the end of my process. It does not
display the information neatly. Is there a way to change
the following code to (1) center the information on each
line in the msgbox and (2) break the information where I
want it to break instead of breaking automatically?

MsgBox "JE" & vID & " " & vDate & " " & LineCounter
& "lines " & Chr(13) & vResp & Chr(13) & " in " & Round
(vStop - vStart, 1) & " seconds"

Thanks for the help.
 
You could try something like this:

Sub test()
MsgBox myPretty$("ABC " & Now, Date, "XXXXXXXXX", "", "byeeeee")
End Sub

Function myPretty$(ParamArray v() As Variant)
Dim i%, outPut$
outPut$ = v(0)
For i% = 1 To UBound(v)
outPut$ = outPut$ & vbNewLine & v(i%)
Next i%
myPretty$ = outPut$
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

MsgBox problem 3
MsgBox Syntax 3
MsgBox Screen Position 2
Help. Sumproduct Data Type Mismatch Erro 3
FileSearch misbehaving 8
Rich Text Format 0
how do i change font size in msgbox 1
MsgBox line break 1

Back
Top