The Msg Box function

The purpose of the MsgBox function is to display results. A simple example of output using it is illustrated in Figure 3.6. Notice that a generic MsgBox contains only an OK button. A title - the default being Microsoft Excel in the absence of the programmer supplying one - and some output contained in the MsgBox (in this case the message: 'Hello!').

The VBA statement:

MsgBox "Hello!"

Would produce the output as shown in Figure 3.6.

Figure 3.6 The MsgBox Function

0 0

Post a comment