Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to autostart a macro?

Can a macro be self-starting based on some event?

Events such as:
1) opening the file
2) preset time
3) value of certain cell contents

Trying to set a spreadsheet to run a series of queries and macros every
night.

Also hope to learn if i can set up a series of queries and macros to run in
sequence whether autostart or not.

Could these macros run even if the Excel file is not open?



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default How to autostart a macro?

#1. You can use a sub named: Auto_Open (placed in a General module)
or you can use the Workbook_Open event in the ThisWorkbook module.

#2. You can use application.ontime to start a macro when you want.
Chip Pearson shows how:
http://www.cpearson.com/excel/OnTime.aspx

#3. If the value changes because of the user typing something, you can use the
worksheet_change. If the value changes because of a formula recalculating, you
can use the worksheet_calculate event.

If you're new to macros:

Debra Dalgleish has some notes how to implement macros he
http://www.contextures.com/xlvba01.html

David McRitchie has an intro to macros:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Ron de Bruin's intro to macros:
http://www.rondebruin.nl/code.htm

(General, Regular and Standard modules all describe the same thing.)

Chip Pearson has some instructions on events:
http://www.cpearson.com/excel/events.htm

David McRitchie has some notes, too:
http://www.mvps.org/dmcritchie/excel/event.htm

There are application events, too.
You can read more about application events at Chip Pearson's site:
http://www.cpearson.com/excel/AppEvent.aspx

Delivery wrote:

Can a macro be self-starting based on some event?

Events such as:
1) opening the file
2) preset time
3) value of certain cell contents

Trying to set a spreadsheet to run a series of queries and macros every
night.

Also hope to learn if i can set up a series of queries and macros to run in
sequence whether autostart or not.

Could these macros run even if the Excel file is not open?


--

Dave Peterson
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
Autostart macro-protect file Mia Excel Programming 7 June 9th 09 01:24 PM
Autostart Macro McCloudK Excel Discussion (Misc queries) 5 November 22nd 07 09:38 PM
Autostart Alias Excel Discussion (Misc queries) 2 December 8th 05 02:43 AM
Delete an autostart Sub with code Tempy Excel Programming 6 June 14th 04 08:20 PM
Autostart syale Excel Programming 1 January 29th 04 02:07 AM


All times are GMT +1. The time now is 01:22 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"