Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 217
Default Macro expires

Hello
I have a simple OnSave macro that that i have created. In cell b3 is the
date (mm/dd/yy). I would like for the onsave macro not to run if the mpnth
is later than that in b3. In other words after the last day of the month the
macro no longer runs. What code should I add to accomplish this?
Thanks
Louise
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Macro expires

Hi Louise

One way is to use this function in a cell ( I use C3)
to get the last day of the month

=DATE(YEAR(B3),MONTH(B3)+1,0)

And in the macro use this (first line)

If Now Sheets("Sheet1").Range("C3").Value Then Exit Sub



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Louise" wrote in message ...
Hello
I have a simple OnSave macro that that i have created. In cell b3 is the
date (mm/dd/yy). I would like for the onsave macro not to run if the mpnth
is later than that in b3. In other words after the last day of the month the
macro no longer runs. What code should I add to accomplish this?
Thanks
Louise



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 217
Default Macro expires

works great thanks!

"Ron de Bruin" wrote:

Hi Louise

One way is to use this function in a cell ( I use C3)
to get the last day of the month

=DATE(YEAR(B3),MONTH(B3)+1,0)

And in the macro use this (first line)

If Now Sheets("Sheet1").Range("C3").Value Then Exit Sub



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Louise" wrote in message ...
Hello
I have a simple OnSave macro that that i have created. In cell b3 is the
date (mm/dd/yy). I would like for the onsave macro not to run if the mpnth
is later than that in b3. In other words after the last day of the month the
macro no longer runs. What code should I add to accomplish this?
Thanks
Louise




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
Encryption Password Expires in 30 Days Rob Excel Discussion (Misc queries) 0 April 2nd 09 07:08 PM
Date expires in 2 years Catguam Excel Worksheet Functions 2 September 22nd 08 09:01 PM
Send mail when deadline expires The Fool on the Hill Excel Discussion (Misc queries) 0 July 27th 07 10:42 AM
How to set up alarm for cell has entry as date when it expires? Vinod Menon Excel Worksheet Functions 1 October 18th 05 06:20 AM
creating a demo that expires after time S. Housley Excel Programming 0 June 24th 04 06:36 PM


All times are GMT +1. The time now is 06:53 PM.

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"