message box text

S

sako 338

is it possible to change the "OK" text in a message box. the message box does
what i need, but i want to alter the text from "OK" to a word of my choice
 
J

John Bundy

The best thing to do is create a userform and put your own button on and
userform.show when you need it
 
M

Martin Fishlock

Hi Sako,

You cannot set custom text on buttons to a msgbox command.

You have the option of the following button combinations:

OK button only.
OK and Cancel buttons.
Abort, Retry, and Ignore buttons.
Yes, No, and Cancel buttons.
Yes and No buttons.
Retry and Cancel buttons.

Using the various constants (see help).

The solution is to try and form your question to match the buttons.

Instead of 'Which language would you like to use?' and have two buttons
'English' and 'Thai'. Have 'Would you like to switch the language from
English to Thai? and use 'Yes' and 'No' with vbYesNo constant.

The other solution is to wirte VBA that emulates the msgbox function.

This way you can set the text to the captions by passing parameters to the
function.
 
Top