I want to run a macro every time an excel files opens and before it closes. I've tried using the below script but it didn't work.
Private Sub Worksheet_Activate() 'my macro End Sub
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
Private Sub Workbook_Open() ' dosomething End Sub
Sub Auto_Open()in a module
Private Sub Workbook_BeforeClose(Cancel As Boolean) ' dosomething End Sub
Sub Auto_Close()in a module