Excel like a finance pro.
VBA · Events
Workbook_Open
Runs when the file opens; used for setup or reminders.
When to use it
Workbook_Open runs when the file opens (if macros are enabled). Use it for setup: landing on a home sheet, refreshing data, or showing a reminder.
The code
- Code
Private Sub Workbook_Open() Worksheets("Home").Activate End Sub
Worked examples
Land on a sheet
Private Sub Workbook_Open() Worksheets("Home").Activate End Sub → Always opens on the Home sheet
A friendly start.
Refresh on open
Private Sub Workbook_Open() ThisWorkbook.RefreshAll End Sub → Refreshes queries and pivots on open
Fresh data every time.
Reminder
Private Sub Workbook_Open() If Date > DateSerial(2026, 1, 1) Then MsgBox "Update the rates" End Sub → A dated reminder
Maintenance nudges.
Worth knowing
- Hold Shift while opening to skip it.
- Auto_Open in a standard module is the older equivalent.
- Keep it fast; users are waiting.
Where it goes wrong
- Does not run when macros are blocked, so never rely on it for security.
- Errors in it make the file appear broken on open.
Related
Learn the moves here — or let Wauvel run them on your numbers.
Meet your AI CFO →One CFO-grade Excel tip a week
A short, practical email for finance operators — functions, shortcuts, and the moves that save an afternoon. Free, unsubscribe anytime.