To post as a guest, your comment is unpublished.· 1 years agoHi Kavitha,
Which Excel version are you using?
How to pop up a message box upon activating/opening a specified worksheet in Excel?
You may need a message box pop up to remind you about the details of a worksheet when you activating it in Excel. Please try the below method.
The following VBA code can help you to pop up message box when activating a specified worksheet.
1. Press Alt + F11 keys simultaneously to open the Microsoft Visual Basic for Applications window.
2. In the Microsoft Visual Basic for Applications window, double click ThisWorkbook in the Project pane to open the ThisWorkbook (Code) window. And then copy and paste the below VBA code into the code window.
VBA code: Pop up message box upon activating a specified worksheet
Private Sub Workbook_SheetActivate(ByVal Sh As Object) On Error Resume Next If Sh.Name = "Sheet1" Then MsgBox "Please remember to fill in the daily sale", vbInformation, "Kutools for Excel" End If End Sub
Note: In the code, please replace Sheet1 with your specified sheet name. And replace the message box content “Please remember to fill in the daily sale” with the content you need.
3. Press Alt + Q keys simultaneously to close the Microsoft Visual Basic for Applications window.
From now on, when activating or opening this worksheet, a message box will always pop up as below screenshot shown.
- How to create a message box timer to auto close the message box after certain time in Excel?
- How to pop up message box when clicking on a certain cell in Excel?
- How to copy text from message box in Excel?
- How to pop up message box to display range of cells or cell values in Excel?
- How to pop up message box if cell value changes within a range in Excel?
You are guest
or post as a guest, but your post won't be published automatically.
To post as a guest, your comment is unpublished.· 1 years agoI am getting compile error. Please help me to rectify the error
To post as a guest, your comment is unpublished.· 4 years agowhen I copy this I get a compile error: Expected: end of statement.
I don't understand why