msgbox

A

Anna

Hi,

I am creating a msgbox which will pop-up when open up the project file.
Well..is there any way I can set up the size of the msgbox? I mean.. fix the
size of that pop-up window. Because the size is different on different size
screens. I want to set up the size of this window because its just moves all
the text here and there I mean it mess up all the formatting that I have for
the text ( I have few lines of text that I want them to be like this:
1....
2...
3....

Should be left aligned when pop-up in the message box)

Your help is urgenlty needed. Thanks in advance
 
G

Gerard Ducouret

Hello Anna,

Insert some vbLf or vbTab in the string you display in the MsgBox (See the
VBA Help on these constants.)

Hope this helps,

Gérard Ducouret
 
A

Anna

Hi Gerard,

I tried to look these conrtants in VBA help but I couldn't find it. If you
could give an example like how to use these contants in order to get multiple
line msg box. I would appreciate it.

Thanks
 
J

John

Anna,
I'm not sure if Gerard is "on the air" on Sunday so here's an example
from one of my macros.

MsgBox "There are no tasks in this file." & Chr(13) & _
"Please open a populated file and run again.", vbCritical, _
"Resource Data to Excel - Fatal Error"

"Chr(13)" is ASCII code for a carriage return. A line feed is "Chr(10)".
Note that the text string needs to be broken at the point of the
carriage return. This example also includes line continuation character
sequences (i.e. " _"). This does NOT put a carriage return or line feed
into the printed message. It is strictly a syntax format for VBA code
when long code lines are broken up for easier reading.

Hope this helps.
John
Project MVP
 
A

Anna

John,

Thank you so very much. This works just great. I greatly appreciate your help.
Thanks again
 

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

Top