+ Reply to Thread
Results 1 to 8 of 8

Copy entire rows of data to another tab based on dates

  1. #1
    Registered User
    Join Date
    02-13-2013
    Location
    Grand Rapids, Michigan, USA
    MS-Off Ver
    Excel 2007
    Posts
    15

    Copy entire rows of data to another tab based on dates

    Hello,

    I am pretty much teaching myself VB as I go with the projects my manager gives me. This excel I am working on is the location where all the people who have called in sick or absent for the day are documented and the occurrences are tracked. But after a year, the occurrences are dropped. So what I am looking for is a macro that will automatically take these 'old' entries and place them in the old entries tab. It is something that needs to be automatic so that no one needs to even know its running.

    The sheet where the data is stored is called "Call In's" and the tab where the outdated information goes is called "OldEntries"

    The range of cells being used in a row is from A to J at the moment (the end could change as we put more data in there). The date that would be used is entered is in the column E.

    Thank you so much for your help. I am not finding the answer anywhere.
    photochic10

  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: Copy entire rows of data to another tab based on dates

    Hi Photochic,

    Try this:

    Please Login or Register  to view this content.
    Directions for running the routine(s) just supplied

    Copy the code to the clipboard

    Press ALT + F11 to open the Visual Basic Editor.

    Open a macro-enabled Workbook or save your Workbook As Macro-Enabled

    Select ThisWorkbook as directed above from the Insert menu

    Type "Option Explicit" then paste the code under it

    With the cursor between Sub and End Sub press F5 (F8 to Single Step)

    OR

    Press ALT + Q to close the code window.
    Last edited by xladept; 02-15-2013 at 03:16 PM.
    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 Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Copy entire rows of data to another tab based on dates

    Duplicate Post
    Last edited by xladept; 02-15-2013 at 04:00 PM. Reason: Duplicate Post

  4. #4
    Registered User
    Join Date
    02-13-2013
    Location
    Grand Rapids, Michigan, USA
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Copy entire rows of data to another tab based on dates

    Thank you so much xladept!

    This is working, except for it seems to never stop running (causing the excel to go crazy, kinda blinking and not stoping) could this be caused because there are about 1000 entries? I pressed escape and clicked on 'debug' it has the highlight on the ro : rc = rc - 1. is this something that can be fixed?

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

    Re: Copy entire rows of data to another tab based on dates

    Oops! try the code below in place of Chic:

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    02-13-2013
    Location
    Grand Rapids, Michigan, USA
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Copy entire rows of data to another tab based on dates

    Awesome! It works perfect! Thank you so much xaldept.

  7. #7
    Registered User
    Join Date
    02-13-2013
    Location
    Grand Rapids, Michigan, USA
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Copy entire rows of data to another tab based on dates

    Well, It did. Now what it is doing is always copying the row into the the row 2 in the 'oldentries' tab. Therefore replacing the ones previously put in there. Is there a way for it to just go into the next open row? Thanks!

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

    Re: Copy entire rows of data to another tab based on dates

    Add one to the row finder:

    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