Adding a message box to Excel Macros

posted in: Excel Tutorials | 2

Adding a message box to Excel Macros

For a guide to how to edit macros for your own purposes, please click here.

In this video we outline how to add a Message box to macros in Microsoft excel. This is useful for outlining what a macro will execute before this occurs if posted before your macro code, or providing a message to let a user know a macro has run successfully if the message is posted after the macro code has run.

 

The code we used in this video is as follows.

Private Sub CommandButton1_Click()

MsgBox (“This Macro will insert a new row”)

Sheets(“Sheet1”).Range(“A4”).Select
ActiveCell.EntireRow.Insert shift:=xlDown

Sheets(“Sheet1”).Range(“A4:E4”).Select
Selection.Borders.Weight = xlThin

End Sub

If you would like to download a copy of the workbook please visit the link below.

Macro Message Box

If you have any questions then please post these in the comments.

 

Please visit my YouTube channel and like/subscribe if this has been helpful.

 

2 Responses

  1. Ryan Cannon

    I would like to insert data or words in my new row using a pop up box.

    • twoperscent

      Hi Ryan,

      The following video addresses how you can do this.

      twoperscent

Leave a Reply