![]() |
Running macro on open of workbook?
Hello,
How do I set up a macro within a workbook to run when it opens, and when the macro is done running a message box saying Macro Finished? Any help?? Lime |
Running macro on open of workbook?
Put this in ThisWorkbook in VBA Private Sub Workbook_Open() Call whateveryourmacroiscalled() MsgBox ("Macro Finished") End Su -- Bearacad ----------------------------------------------------------------------- Bearacade's Profile: http://www.excelforum.com/member.php...fo&userid=3501 View this thread: http://www.excelforum.com/showthread.php?threadid=55193 |
Running macro on open of workbook?
Read this page
http://www.cpearson.com/excel/events.htm Try this example Private Sub Workbook_Open() Dim sh As Worksheet For Each sh In ThisWorkbook.Worksheets sh.Range("A1").Value = Format(Date, "dd-mmm-yyyy") Next sh MsgBox "All sheets have today's date in A1" End Sub -- Regards Ron De Bruin http://www.rondebruin.nl "Lime" wrote in message ... Hello, How do I set up a macro within a workbook to run when it opens, and when the macro is done running a message box saying Macro Finished? Any help?? Lime |
Running macro on open of workbook?
Here is what I have but it is not working, Am i Missing something??
Private Sub workbook_Open() Sub addsheet() Sheets("Sheet2").Select Sheets.Add MsgBox ("Macro finished") "Bearacade" wrote: Put this in ThisWorkbook in VBA Private Sub Workbook_Open() Call whateveryourmacroiscalled() MsgBox ("Macro Finished") End Sub -- Bearacade ------------------------------------------------------------------------ Bearacade's Profile: http://www.excelforum.com/member.php...o&userid=35016 View this thread: http://www.excelforum.com/showthread...hreadid=551938 |
Running macro on open of workbook?
I got it... DUHA
"Lime" wrote: Here is what I have but it is not working, Am i Missing something?? Private Sub workbook_Open() Sub addsheet() Sheets("Sheet2").Select Sheets.Add MsgBox ("Macro finished") "Bearacade" wrote: Put this in ThisWorkbook in VBA Private Sub Workbook_Open() Call whateveryourmacroiscalled() MsgBox ("Macro Finished") End Sub -- Bearacade ------------------------------------------------------------------------ Bearacade's Profile: http://www.excelforum.com/member.php...o&userid=35016 View this thread: http://www.excelforum.com/showthread...hreadid=551938 |
Running macro on open of workbook?
Thank you all for you help...
"Lime" wrote: Here is what I have but it is not working, Am i Missing something?? Private Sub workbook_Open() Sub addsheet() Sheets("Sheet2").Select Sheets.Add MsgBox ("Macro finished") "Bearacade" wrote: Put this in ThisWorkbook in VBA Private Sub Workbook_Open() Call whateveryourmacroiscalled() MsgBox ("Macro Finished") End Sub -- Bearacade ------------------------------------------------------------------------ Bearacade's Profile: http://www.excelforum.com/member.php...o&userid=35016 View this thread: http://www.excelforum.com/showthread...hreadid=551938 |
All times are GMT +1. The time now is 07:06 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com