Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
message box - title change
I have a userform which calls up a msg box
How does one change the title of the msgbox? At present it reads Microsoft Excel - I want to change what it says At present my code reads as follows MsgBox "Instructions", vbInformation Can anyone help with the correct syntax? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
message box - title change
Exmpl:
MsgBox "Instructions", vbInformation, "THIS IS THE TITLE" In the VBA help file under MsgBox Function MsgBox(prompt[, buttons] [, title] [, helpfile, context]) The MsgBox function syntax has these named arguments: Part Description prompt - Required. String expression displayed as the message in the dialog box. The maximum length of prompt is approximately 1024 characters, depending on the width of the characters used. If prompt consists of more than one line, you can separate the lines using a carriage return character (Chr(13)), a linefeed character (Chr(10)), or carriage return - linefeed character combination (Chr(13) & Chr(10)) between each line. buttons - Optional. Numeric expression that is the sum of values specifying the number and type of buttons to display, the icon style to use, the identity of the default button, and the modality of the message box. If omitted, the default value for buttons is 0. title - Optional. String expression displayed in the title bar of the dialog box. If you omit title, the application name is placed in the title bar. helpfile - Optional. String expression that identifies the Help file to use to provide context-sensitive Help for the dialog box. If helpfile is provided, context must also be provided. context - Optional. Numeric expression that is the Help context number assigned to the appropriate Help topic by the Help author. If context is provided, helpfile must also be provided. "Roger on Excel" wrote in message ... I have a userform which calls up a msg box How does one change the title of the msgbox? At present it reads Microsoft Excel - I want to change what it says At present my code reads as follows MsgBox "Instructions", vbInformation Can anyone help with the correct syntax? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
message box - title change
I like named parameters:
MsgBox Prompt:="Instructions", Buttons:=vbInformation, Title:="New title here" But you could use: MsgBox "instructions", vbInformation, "new title here" since those are the first three positional parms to the msgbox function. Roger on Excel wrote: I have a userform which calls up a msg box How does one change the title of the msgbox? At present it reads Microsoft Excel - I want to change what it says At present my code reads as follows MsgBox "Instructions", vbInformation Can anyone help with the correct syntax? -- Dave Peterson |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
message box - title change
ps. VBA's help has a better description.
Roger on Excel wrote: I have a userform which calls up a msg box How does one change the title of the msgbox? At present it reads Microsoft Excel - I want to change what it says At present my code reads as follows MsgBox "Instructions", vbInformation Can anyone help with the correct syntax? -- Dave Peterson |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
message box - title change
hi
a direct copy/paste from vb help.... Dim Msg, Style, Title, Help, Ctxt, Response, MyString Msg = "Do you want to continue ?" ' Define message. Style = vbYesNo + vbCritical + vbDefaultButton2 ' Define buttons. Title = "MsgBox Demonstration" ' Define title. Help = "DEMO.HLP" ' Define Help file. Ctxt = 1000 ' Define topic ' context. ' Display message. Response = MsgBox(Msg, Style, Title, Help, Ctxt) If Response = vbYes Then ' User chose Yes. MyString = "Yes" ' Perform some action. Else ' User chose No. MyString = "No" ' Perform some action. End If Press ALT+F11 to bring up the vb editor. in vb help, type MsgBox. click on the Msgbox function for more details. "Roger on Excel" wrote: I have a userform which calls up a msg box How does one change the title of the msgbox? At present it reads Microsoft Excel - I want to change what it says At present my code reads as follows MsgBox "Instructions", vbInformation Can anyone help with the correct syntax? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Cannot change title of second chart | Charts and Charting in Excel | |||
Change the name of the title bar to the name of the worksheet. | Excel Programming | |||
Change Title of Spreadsheet | Excel Discussion (Misc queries) | |||
VBA to Change Font in title | Charts and Charting in Excel | |||
Change Title Bar | Excel Discussion (Misc queries) |