Monday, December 23

VBA Excel Workbook Open Event

  1. Open Excel File
  2. Click Alt + F11 Or Click On Developer Tab And Go Visual Basic Application.
  3. One Dialog Screen Will Get Open.
  4. Click Insert And Add Module.
  5. Create Sub Procedure With Any Name.
  6. Make Sure The Procedure Name Start With String And Without Space.
  7. Write The Code In Between Sub And Sub End.
  8. Click Run Button Or Insert A Form Button In Excel Sheet.
  9. Any Sub Procedure / Macro Can Be Assign To A Button.
  10. Then Goto Visual Basic Editor And Select Thisworkbook And Then Change The Event To Workbook From The Dropdown As Shown In Image.
  11. One Sub Procedure Will Automatically Get Prepared
  12. Private Sub Workbook_Open() End Sub
  13. In That Procedure Whatever Event You Want To Get Fire You Will Have To Right The Code According To It.
  14. In This Example We Will Delete Hide And Unhide The Rows.
  15. That’s It 🙂
  16. Please Check The Images And Video For More Info.

Leave a Reply

Your email address will not be published. Required fields are marked *