lining up columns in messagebox

  • Thread starter Thread starter RB Smissaert
  • Start date Start date
R

RB Smissaert

Does anybody have a (nearly) foolproof method to line up
columns in a message box?
I know this can be done with vbTab and maybe padding the
strings, but I haven't got a method that always does this job.
I know I could do it with a form, but I prefer the simple
message box.
Thanks for any advice.

RBS
 
try
Sub messageboxv()
MsgBox "hi there" & vbCr & "second line"
End Sub
 
I don't want to split the strings up with vbCr.
I need to align strings in columns.
Something like this often works:

MsgBox "string 1" & vbTab & "string 2" & _
vbCrLf & _
"s3" & vbTab & "s4"

But not always.

If you do for example this:

MsgBox "stringxxxxxxxx 1" & vbTab & "string 2" & _
vbCrLf & _
"s3" & vbTab & "s4"

It won't align anymore.
I am just looking for a foolproof method like a general purpose function
that will always gets the strings aligned, no matter what the lengths are.

RBS
 

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

Back
Top