MESSAGEBOX

imported_unknown

Active Member
Joined
Jan 13, 2002
Messages
424
Is it possible when using a messagebox that the message is in the center and not all to the left? Hope someone can help me. Thanks.
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
The MsgBox does not accept the "xlCenter" property. To center you will need to pad your lines with spaces and returns, like:

Sub myMsg()
MsgBox " Nice!" & Chr(13) & " Work!"

End Sub

Hope this helps. JSW

P.S. The board may have removed the displayed spaces from the code above.
This message was edited by Joe Was on 2002-10-03 18:21
 
Upvote 0
You mean like this?

Sub myMsg() 
MsgBox "                  Nice!                   " & Chr(13) & "                    Work!                        " 

End Sub 
 
Upvote 0
Yes and no, your leading spaces yes, your trailing spaces no, adding trailing spaces just enlarges the box. JSW
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,561
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top