+ Reply to Thread
Results 1 to 12 of 12

Expired data copy to another sheet. But expired data repeat when i run it.

  1. #1
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Expired data copy to another sheet. But expired data repeat when i run it.

    Hi, my company has a Data tab where it has all the contract. It has all the expiry date. As and when, the admin will manually copy and paste those expired contract to another sheet call "Expiry". I am thinking of writing a VBA which will Copy and paste those Expired Contract to the "Expiry" tab. Hence i write the code whenever the "Expiry" tab is activated.

    Please Login or Register  to view this content.
    I realise that the Expired data will repeat whenever i select Expiry tab. Hence making it useless... Is there a way to solve it? i know i can solve the problem by adding a Clear Content on top. But i believe there is a better way to do it. Please advice.... =)
    Attached Files Attached Files

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Expired data copy to another sheet. But expired data repeat when i run it.

    Try this:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Re: Expired data copy to another sheet. But expired data repeat when i run it.

    Hi, it seems to work. But how come it include those > today??

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Expired data copy to another sheet. But expired data repeat when i run it.

    On the expiry tab you're only getting previous dates What do you want

  5. #5
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Re: Expired data copy to another sheet. But expired data repeat when i run it.

    Ya, the expiry tab should show onli expired date. I copy n paste ur code, but those "after today" is being Copy n paste too.

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Expired data copy to another sheet. But expired data repeat when i run it.

    That's not happening on my system - have you extracted your code??

  7. #7
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Re: Expired data copy to another sheet. But expired data repeat when i run it.

    Hi, see my file...
    Maybe its setting issue???
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Re: Expired data copy to another sheet. But expired data repeat when i run it.

    Hey, weird. I tried to with date like 01/01/2020. It wont copy and paste.
    Hence i key in 01/01/2018 to 31/12/2018. Then weird, it will copy till 03/10/2018. I aso duno y it will stop at that date.
    If onli i can make a video to show u.... see the excel for "proof"
    Attached Files Attached Files

  9. #9
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Expired data copy to another sheet. But expired data repeat when i run it.

    Try this, it clears the expiry sheet first - looks like it was just replacing the pertinent rows, so when you had the entire data on the expiry, it was working but made effectively no change in the display

    Please Login or Register  to view this content.

  10. #10
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Expired data copy to another sheet. But expired data repeat when i run it.

    But 01/01/2018 to 31/12/2018 are all previous dates, is there another criterion for the filter?

  11. #11
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Re: Expired data copy to another sheet. But expired data repeat when i run it.

    I think u misunderstood. I mean i wan the code to Copy and Paste only Date BEFORE today to Expiry Tab. Hence, if my data has 01/01/2018 to 31/12/2018, it should copy 01/01/2018 to 09/04/2018 to the expiry tab if i run the Code. N tomorrow, if i run the code, it should Copy and Paste 10/04/2018. If i run the code again on 15/04/2018, it should copy n paste 11/04/2018 to 14/04/2018.
    But now, it copy 01/01/2018 to 03/10/2018 to expiry tab. i duno y it will copy till that date too.

  12. #12
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Expired data copy to another sheet. But expired data repeat when i run it.

    I mean i wan the code to Copy and Paste only Date BEFORE today to Expiry Tab
    But, isn't that what it does

+ 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. Chemical Inventory: Making expired sheet from below
    By gdclyde in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-29-2016, 10:32 AM
  2. VBA Copy Formula to Value on another Sheet after time (Today(o)) has expired
    By VBAStarter in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-26-2015, 05:44 AM
  3. [SOLVED] delete cell data based off expired date
    By Loadtoad in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-19-2014, 11:35 PM
  4. Need expired dates to be moved to a different work sheet
    By tward in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-07-2014, 04:40 PM
  5. Replies: 2
    Last Post: 03-03-2013, 12:46 PM
  6. Track expired items in separate sheet
    By ctgo4it in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-21-2012, 03:01 PM
  7. expired tests copied to another sheet
    By leem in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-04-2010, 04:05 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