How to trigger Excel macro on opening workbook

Opening of workbook is a Workbook level event and therefore we write it's code in ThisWorkbook object.

Once you open editor for ThisWorkbook, you'll find list of events that are applicable at workbook level.

 
As you select Open event few lines of code automatically get inserted there. And it appear like this:

       Private Sub Workbook_Open()

       End Sub


This sub procedure will be called every time you open this workbook. Whatever you want to execute, you can put inside this sub procedure.

Example:

       Private Sub Workbook_Open()
               Msgbox ("Welcome user!!!")
       End Sub



Extreme Excel Solutions
http://www.ExtremeExcelSolutions.weebly.com