Format in Message Box

  • Thread starter Thread starter Victoria
  • Start date Start date
V

Victoria

I have a Message Box that is composed like...

strMsg = "county : " & cboCounty & vbCrLf & ... etc
MsgBox strMsg & vbInformation

and looks like...

County : Manitoulin
Regional Manager : Joe McGuiness
Code : A45-X

This may be really picky, but I'd like the colons to be lined up vertically
just for appearances sake. It doesn't really work using spaces (just like
I'm sure it won't in this posting). Is there a way to use tabs when
composing the message? Thanks - Victoria
 
It can't be done with the built-in message box. Create your own form with
text boxes and use it instead of the built-in message box.
 
Victoria said:
I have a Message Box that is composed like...

strMsg = "county : " & cboCounty & vbCrLf & ... etc
MsgBox strMsg & vbInformation

and looks like...

County : Manitoulin
Regional Manager : Joe McGuiness
Code : A45-X

This may be really picky, but I'd like the colons to be lined up
vertically
just for appearances sake. It doesn't really work using spaces (just like
I'm sure it won't in this posting). Is there a way to use tabs when
composing the message? Thanks - Victoria

You can use vbTab...

"County" & vbTab & vbTab & vbTab & vbCrLf & _
"Regional Manager" & vbTab & vbCrLf & _
"Code" & vbTab & vbTab & vbTab

....but it might not give consistent results across multiple PCs due to font
size and DPI settings.

(I just guessed on the number of vbTabs to use)
 
Back
Top