Skip to content
VBA Excel Workbook Open Event
Post Views: 717
- Open Excel File
- Click Alt + F11 Or Click On Developer Tab And Go Visual Basic Application.
- One Dialog Screen Will Get Open.
- Click Insert And Add Module.
- Create Sub Procedure With Any Name.
- Make Sure The Procedure Name Start With String And Without Space.
- Write The Code In Between Sub And Sub End.
- Click Run Button Or Insert A Form Button In Excel Sheet.
- Any Sub Procedure / Macro Can Be Assign To A Button.
- Then Goto Visual Basic Editor And Select Thisworkbook And Then Change The Event To Workbook From The Dropdown As Shown In Image.
- One Sub Procedure Will Automatically Get Prepared
- Private Sub Workbook_Open() End Sub
- In That Procedure Whatever Event You Want To Get Fire You Will Have To Right The Code According To It.
- In This Example We Will Delete Hide And Unhide The Rows.
- That’s It 🙂
- Please Check The Images And Video For More Info.