+ Reply to Thread
Results 1 to 8 of 8

Macro to cut/Paste data to sheet2 after 30 days

  1. #1
    Registered User
    Join Date
    01-27-2014
    Location
    Redmond, WA
    MS-Off Ver
    Excel 2007
    Posts
    12

    Macro to cut/Paste data to sheet2 after 30 days

    Sheet 1 contains archived data for my Company's employee access badges. This data needs to be archived, however, using the data is becoming more difficult due to the number of entries. I am hoping to have a macro that will automatically cut/paste all rows for entries made more than 30 days prior to the current date into Sheet 2. The date is in Column A.

  2. #2
    Forum Contributor
    Join Date
    11-05-2013
    Location
    Germany
    MS-Off Ver
    Excel 2013
    Posts
    120

    Re: Macro to cut/Paste data to sheet2 after 30 days

    Please Login or Register  to view this content.
    Say thanks, Click *

  3. #3
    Registered User
    Join Date
    01-27-2014
    Location
    Redmond, WA
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Macro to cut/Paste data to sheet2 after 30 days

    I received a "Run-time error '13': Type mismatch" dialog. Thanks for the help by the way

  4. #4
    Forum Contributor
    Join Date
    11-05-2013
    Location
    Germany
    MS-Off Ver
    Excel 2013
    Posts
    120

    Re: Macro to cut/Paste data to sheet2 after 30 days

    np

    It is hard to help you without having a sample file. Best would be if you post a sample workbook where you use maybe only 20 fake entries for 2 columns and have 2 sheets with some entries in the archive already.

    And for the code to work in general you have to change the "sheet1" and "sheet2" names to fit the names you want the macro to run in.

  5. #5
    Registered User
    Join Date
    01-27-2014
    Location
    Redmond, WA
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Macro to cut/Paste data to sheet2 after 30 days

    hopefully this works I think I attached the file. The sheets haven't been named yet but sheet 1 will be named "Current 30 Days" and Sheet 2 will be "Archive". Sorry it took so long I didn't receive your message before I left work.
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    11-05-2013
    Location
    Germany
    MS-Off Ver
    Excel 2013
    Posts
    120

    Re: Macro to cut/Paste data to sheet2 after 30 days

    that should do it

    Test #2.xlsm
    Last edited by Decar; 11-29-2014 at 07:28 PM.

  7. #7
    Registered User
    Join Date
    01-27-2014
    Location
    Redmond, WA
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Macro to cut/Paste data to sheet2 after 30 days

    It worked except for columns E & G. They were turned into some odd decimal numbers. They are supposed to be time stamps.
    Last edited by Blazingworm; 12-02-2014 at 05:39 PM.

  8. #8
    Registered User
    Join Date
    01-27-2014
    Location
    Redmond, WA
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Macro to cut/Paste data to sheet2 after 30 days

    I figured it out thank you for your help. I needed to change the formatting of the cells to the time setting. And then make sure all the entries contained the colon. And that fixed the issue.

+ 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. Need a macro to delete data on sheet2, copy data from sheet1 to sheet2
    By noorie007 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-03-2014, 02:32 PM
  2. Macro to copy the data from sheet1 and to paste it in sheet2 with conditions.
    By Thinker8 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-17-2014, 09:55 AM
  3. I need help to copy and paste the data as requested sheet2
    By venkatpvc in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-20-2013, 10:36 AM
  4. [SOLVED] Copy data from column A and B Sheet1 and paste into Sheet2
    By rabra in forum Excel General
    Replies: 2
    Last Post: 02-03-2013, 11:39 AM
  5. Copy data from textfile, paste and transpose to sheet2
    By m4nd4li4 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-14-2005, 05:06 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