+ Reply to Thread
Results 1 to 4 of 4

Copy Sheet based on date

  1. #1
    Registered User
    Join Date
    05-09-2012
    Location
    london
    MS-Off Ver
    excel 2003/2007/2010
    Posts
    15

    Copy Sheet based on date

    Trying to copy a sheet every seven days (or when the user next logs on). Sub is activated by a user pressing a command button. Date of last copy determined by cell c23 on sheet 1.

    Everything works except the "every seven days" element of the sub. It still runs when the value in c24 is less than seven days old. been playing around with various combinations of > < + and -. None seem to work, starting to think i've done something wrong in the formatting of the date?

    Any help would be appreciated as always.

    Please Login or Register  to view this content.
    Thanks all!

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Copy Sheet based on date

    You do not need to store today's date in a variable. Just use the "date" function and you will get the date.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    05-09-2012
    Location
    london
    MS-Off Ver
    excel 2003/2007/2010
    Posts
    15

    Re: Copy Sheet based on date

    Thanks very much for your response Arlu, no longer making additional work for myself needlessly - but still does not solve my issue

    Even if I don't store it as a variable, if the date in c23 is 6 days old it still runs the rest of the code when it shouldn't.

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Copy Sheet based on date

    Try this
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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