ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   lining up columns in messagebox (https://www.excelbanter.com/excel-programming/319524-lining-up-columns-messagebox.html)

RB Smissaert

lining up columns in messagebox
 
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

Don Guillett[_4_]

lining up columns in messagebox
 
try
Sub messageboxv()
MsgBox "hi there" & vbCr & "second line"
End Sub

--
Don Guillett
SalesAid Software

"RB Smissaert" wrote in message
...
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




RB Smissaert

lining up columns in messagebox
 
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



"Don Guillett" wrote in message
...
try
Sub messageboxv()
MsgBox "hi there" & vbCr & "second line"
End Sub

--
Don Guillett
SalesAid Software

"RB Smissaert" wrote in message
...
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






All times are GMT +1. The time now is 12:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com