Joke Collection Website - Public benefit messages - How to display information in msgbox of VBA

How to display information in msgbox of VBA

1. First open Excel20 13, press Alt+F 1 1 to switch to the VBA interface, click Insert in the VBA menu bar, select a module in the drop-down menu, and insert a module:

3. Enter the code in the newly created module and set a msgbox form, in which the code "? Chr( 13)? "That is, the carriage return newline:

3. Then click the User Form button to run the subroutine in vba. The shortcut key of this button is F5, which can run the program quickly:

4. Finally, a window will pop up. At this time, you can see that the number 1 in msgbox occupies the first line, the number 2 occupies the second line, and the number 3 occupies the third line, which realizes the effect of displaying messages in the new line: