+ Reply to Thread
Results 1 to 10 of 10

Macro with an end date

  1. #1
    Forum Contributor
    Join Date
    11-25-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    200

    Macro with an end date

    I am currently using the following at the beginning of a macro to give it an end date. However, this can be easily manipulated by changing the computer's system date. Is there a way to make it where the system date will not matter? Thank you!


    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Macro with an end date

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    11-25-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    200

    Re: Macro with an end date

    But won't that just close the workbook no matter what the date is? I want to be able to specify a date or a number of days remaining if possible. Thank you!

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Macro with an end date

    Date is the system date. You can add plus and minus to date,like
    Date-1 is yesterday.

  5. #5
    Forum Contributor
    Join Date
    11-25-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    200

    Re: Macro with an end date

    Then the exdate will always be equal to the system date and will never shutdown with the way I have it written. Would I have to add another line or 2? Please help. Thanks.

  6. #6
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Macro with an end date

    I am not sure I understood your request, but you can add else statement or do elseif

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    11-25-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    200

    Re: Macro with an end date

    I will try and explain it better then. I have that code at the beginning of a macro. I want that macro (if the macro button is pushed) to close the worksheet after 5/31/15. But at this point with the way I have it written, all they have to do is change the system date to 5/30 (or anything before) and the macro will work. I want to know if there is a code that that ensure it closes even if they do backdate the system date. Does that make more sense? Thank you!

  8. #8
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Macro with an end date

    The simple answer is: I do not know.

  9. #9
    Forum Contributor
    Join Date
    11-25-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    200

    Re: Macro with an end date

    Thanks and I love your honesty!! I appreciate the attempt!

  10. #10
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Macro with an end date

    Why do you want to make the code unavailable after a certain date?
    If posting code please use code tags, see here.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Macro to find Date Cells > Current Date and delete everything to left of that cell
    By LewisLonsdale in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-25-2015, 06:36 AM
  2. Prompt user to enter date, then validate date, then continue with macro
    By rgiglio7489 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-18-2014, 04:54 PM
  3. [SOLVED] Macro to match date in data table and copy cell range containing date.
    By 54ed in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-15-2014, 04:52 AM
  4. Macro to Change color of cell after cross referencing date with a given date.
    By liajet24 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-24-2013, 12:33 PM
  5. create a macro to alert me if today's date is within 5 days of expected delivery date
    By ashmcclure in forum Excel Programming / VBA / Macros
    Replies: 25
    Last Post: 09-25-2008, 05:51 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1