This post will guide you how to create a pop up message box when you open a workbook in Excel. How do I create a message box in Excel using VBA and pop up whenever you open your workbook or excel file in Excel.
Display Message Box When Opening a Workbook
If you want to display a message box when a particular workbook is opened, you can use an Excel VBA macro to achieve the result. Just do the following steps:
Step1: open your excel workbook and then click on “Visual Basic” command under DEVELOPER Tab, or just press “ALT+F11” shortcut.
Step2: then the “Visual Basic Editor” window will appear.
Step3: double click on ThisWorkbook object under VBAProject pane, and the Code window for “ThisWorkbook” should be appear.
Step4: copy and past the below VBA Macro code into the code window.
Private Sub Workbook_Open() MsgBox "pop up message box" End Sub
Step5: click Save button, that save this workbook as Excel macro-Enabled Workbook, you need to select Excel Macro-Enabled Workbook from the Save as type list box.
Step6: reopen that workbook with VBA Macro, and you will see a security warning message at the top of the current worksheet. Click Enable Content button to activate the VBA macro.
Step7: A message box should be popped up.