+ Reply to Thread
Results 1 to 6 of 6

Having a problem with Save/Close after a certain date macro

  1. #1
    Registered User
    Join Date
    08-18-2015
    Location
    Istanbul, Turkey
    MS-Off Ver
    Office 2010
    Posts
    3

    Having a problem with Save/Close after a certain date macro

    Hi everyone... I have a problem with a macro that I'm trying to put together... I currently have a copy - paste value macro that I use to break circularities which works fine but I want this additional Save/Close macro to work after a certain date and delete certain cells and then save/close the Excel file... Kind of like an expiration date for the workbook...

    The code I have is...

    If Range("Today_date") < Range("Valid_date") Then Application.DisplayAlerts = False
    With ThisWorkbook
    .Save
    .Close
    End With
    Application.DisplayAlerts = True

    This saves and closes the file whether Today_date is larger or smaller than Valid_date and skips the copy - paste macro... Will appreciate all the help I can get...

    Thank you in advance...

  2. #2
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: Having a problem with Save/Close after a certain date macro

    What exactly is it that you'd like to do?

    Please Login or Register  to view this content.
    Last edited by berlan; 08-19-2015 at 08:59 AM.

  3. #3
    Registered User
    Join Date
    08-18-2015
    Location
    Istanbul, Turkey
    MS-Off Ver
    Office 2010
    Posts
    3

    Re: Having a problem with Save/Close after a certain date macro

    Thank you for your answer berlan...

    I need the macro to save and close the Excel file when today's date is larger than the expiration date. If not, then the actual macro should run... Right now whether today's date is larger or smaller than the expiration date the macro saves and closes the file...

  4. #4
    Valued Forum Contributor Parth007's Avatar
    Join Date
    12-01-2014
    Location
    Banglore
    MS-Off Ver
    2010
    Posts
    879

    Re: Having a problem with Save/Close after a certain date macro

    maybe
    Please Login or Register  to view this content.
    Regards
    Parth

    I appreciate your feedback. Hit * if u Like.
    Rules - http://www.excelforum.com/forum-rule...rum-rules.html

  5. #5
    Registered User
    Join Date
    08-18-2015
    Location
    Istanbul, Turkey
    MS-Off Ver
    Office 2010
    Posts
    3

    Re: Having a problem with Save/Close after a certain date macro

    Thank you Parth007... The macro works as the way it should... Now all my models have an expiration date

  6. #6
    Valued Forum Contributor Parth007's Avatar
    Join Date
    12-01-2014
    Location
    Banglore
    MS-Off Ver
    2010
    Posts
    879

    Re: Having a problem with Save/Close after a certain date macro

    hey thats great.. please mark thread as solved

+ 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. [SOLVED] Add functions to a save before close macro
    By JohnDoh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-10-2015, 05:01 AM
  2. Macro to Save current XLS, then to save as a CSV. Then close CSV and reopen XLS
    By cricker in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-02-2014, 06:17 AM
  3. Replies: 1
    Last Post: 10-25-2013, 06:10 PM
  4. Problem with Save & Close macro and beforeSave event
    By Danny_ in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-18-2013, 04:32 PM
  5. [SOLVED] Macro help - function to close and save
    By jodieduncan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-27-2012, 04:52 AM
  6. Open WB / Run Macro / Save changes /Close WB
    By nachousa in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-24-2010, 01:08 PM
  7. conflict between auto save&close macro and show/hide sheets macro
    By alexandruc in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 10-18-2009, 11:56 AM

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