Sub Auto_Open() Msgbox "Welcome to My Excel Sheet" End Sub
Instructions:
- Open an excel workbook
- Press Alt+F11 to open VBA Editor
- Double click on ThisWorkbook from Project Explorer
- Copy the above code and Paste in the code window
- Save the file as macro enabled workbook
- Open the workbook to test it, it will Run a Macro Automatically. You should see a message box as shown above