Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default 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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default 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


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default 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




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
macro not running on workbook open Nick Smith[_2_] Excel Programming 4 May 11th 06 10:24 AM
Running a macro in a open as read-o Workbook TBarreiro Excel Programming 0 September 2nd 05 04:06 PM
Running a macro in a open as read-o Workbook TBarreiro Excel Programming 0 September 2nd 05 04:02 PM
Running a macro in a open as read-o Workbook TBarreiro Excel Programming 0 September 2nd 05 03:55 PM
Application Error when running Macro on Workbook open TM[_2_] Excel Programming 0 September 15th 03 12:33 PM


All times are GMT +1. The time now is 12:01 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"