MsgBox - 1) custom text in title bar? - 2) icon change?

  • Thread starter StargateFanFromWork
  • Start date
S

StargateFanFromWork

The syntax for Excel for the msgbox is quite similar to
AutoIt's (a freeware scripting program). When I create
message boxes in AutoIt, I can put a "title" or header
info in the title bar of the box.

I've searched various pages on the net looking for syntax
similar to this but for Excel but I haven't seen anything
that shows if this is even possible. If it can be done,
what would the syntax be, pls?

My line of coding looks like this currently:

MsgBox "Getting ready to print ... please insert a pink
sheet of paper into the printer."

I'd like to put the "Getting ready to print ..." in the
title bar if possible.

Also, while doing the abovementioned searching, I did find
a neat piece of code that adds a red circle with an X
through it and this "icon" is added through
the "vbcritical" coding at end of the revised line here:

MsgBox "Getting ready to print ... please insert a pink
sheet of paper into the printer.", vbCritical

I'm thinking the one with a yellow triangle "caution" sign
with an exclamation point would be better for this. Is
this possible; and if so, does anyone know the syntax for
it?

Thanks so much! As always, this is for the benefit of
many people. Cheers. :eek:D
 
B

Bob Phillips

MsgBox "Getting ready to print ... please insert a pink sheet of paper into
the printer.", _
vbexclamation,"Getting ready to print ..."



--

HTH

RP
(remove nothere from the email address if mailing direct)
 
G

Guest

Totally awesome! The vbexclamation put the right icon in!
<g>

Here is how the macro stands now:

************************
Sub Auto_Open()

Dim vResponse As Variant
Do
vResponse = Application.InputBox( _
Prompt:="Enter pay period start date
(in dd/mm/yyyy format):", _
Title:="Start Date", _
Default:=Format(Date, "dd/mm/yyyy"), _
Type:=2)
If vResponse = False Then Exit Sub 'User cancelled
Loop Until IsDate(vResponse)
Range("B8").Value = CDate(vResponse)

MsgBox "Please insert a pink sheet of paper into the
printer. Once you've done that, click ''OK''.",
vbExclamation, "Getting ready to print ..."

Application.Dialogs(xlDialogPrint).Show

End Sub
************************

What this does is makes this time sheet spreadsheet so
easy to use. The user is asked for only one piece of
input, the start date for the 2-week pay period. That
dump populates 16 other dependent cells and then sends the
sheet to the printer after prompting user to insert the
right colour of paper (and PAY is _adamant_ that we follow
the rules down to the letter even down to the colour of
paper <lol>!).

Thanks much everyone. I'm getting better and better at
all this but still need help occasionally. But for
everything item I've asked, I've probably done a gazillion
things on my own. <g>

[snip]
I'd like to put the "Getting ready to print ..." in the
title bar if possible.
[snip]
I'm thinking the one with a yellow triangle "caution" sign
with an exclamation point would be better for this. Is
this possible; and if so, does anyone know the syntax for
it?

[snip]
 
S

StargateFanFromWork

Ah, geez! No wonder I never got anything. I was using
the Help of Excel. Of course, one should be in the VB
editor's help. D'uh!

And it's easier than the yellow syntax box coding that was
coming up when I was typing in the msgbox code. That
yellow box with the syntax was in the way and I all my
trials didn't work. I guess it's because there are
actually not supposed to be any broken brackets <lol>.
The vbexclamation example given in another message in this
thread doesn't have them at all, so that must be why my
title attempt never worked <g>.

Thanks, I may not have saved the wasted search time today,
 

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