ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   MsgBox Justification (https://www.excelbanter.com/excel-programming/293520-msgbox-justification.html)

Bill Oertell[_2_]

MsgBox Justification
 
Is there any way to center the prompt in a MsgBox?



JE McGimpsey

MsgBox Justification
 
AFAIK, the only way is to add spaces to the beginning of the prompt.

You'll have to tweak the values:

MsgBox "Hello"
MsgBox String(40, " ") & "Hello"



In article ,
"Bill Oertell" wrote:

Is there any way to center the prompt in a MsgBox?



Rockee052[_56_]

MsgBox Justification
 
Hi,

I believe you can also use vbTab for spacing...

Rocke

--
Message posted from http://www.ExcelForum.com


Shatin

MsgBox Justification
 
MsgBox String(40, " ") & "Hello"

or MsgBox Space(40) & "Hello"



Shatin

MsgBox Justification
 
or MsgBox Space(40) & "Hello"

Oops, just tried it and it would in fact make the text string right
justified. Should be something like:

MsgBox Space(20) & "Hello" & Space(20)





Bill Oertell[_2_]

MsgBox Justification
 
Thanks. At least that's better than experimenting with: MsgBox(" Hello")

"Shatin" wrote in message
...
or MsgBox Space(40) & "Hello"


Oops, just tried it and it would in fact make the text string right
justified. Should be something like:

MsgBox Space(20) & "Hello" & Space(20)








All times are GMT +1. The time now is 10:06 AM.

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