Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Steve
 
Posts: n/a
Default Autorun macro by date

This is a repost as my one this morning doesn't appear to have saved,
so ap;ologies if I end up raising the same question twice.

I have a macro called 'Update_Me'which I would like to run
automatically on the first of each month (when excel is opened,
obviously). How do I go about this?

Thanks in advance

Steve

  #2   Report Post  
Jason Morin
 
Posts: n/a
Default

Try something like:

Sub Workbook_Open()
Dim dToday As Date
dToday = Now
If Day(dToday) = 1 Then
'rest of code here
End If
End Sub

---
Place this in ThisWorkbook module.

HTH
Jason
Atlanta, GA


"Steve" wrote:

This is a repost as my one this morning doesn't appear to have saved,
so ap;ologies if I end up raising the same question twice.

I have a macro called 'Update_Me'which I would like to run
automatically on the first of each month (when excel is opened,
obviously). How do I go about this?

Thanks in advance

Steve


  #3   Report Post  
Steve
 
Posts: n/a
Default

Hi Jason

I tested this and it worked perfectly. Thank you.

Steve

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
Insert date in macro George Gee New Users to Excel 12 April 17th 06 05:44 AM
How do I insert the date using a macro tara0801 Excel Discussion (Misc queries) 4 February 10th 05 09:09 PM
Date macro Hiking Excel Discussion (Misc queries) 9 February 3rd 05 12:40 AM
how to alter the date within a macro LWhite Excel Discussion (Misc queries) 2 January 4th 05 01:54 PM
Date and Time Macro m.j.anderson Excel Discussion (Misc queries) 1 December 1st 04 12:35 AM


All times are GMT +1. The time now is 02:19 AM.

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

About Us

"It's about Microsoft Excel"