+ Reply to Thread
Results 1 to 4 of 4

Adding Dates at Different Endpoints

  1. #1
    Registered User
    Join Date
    10-13-2010
    Location
    Miami, US
    MS-Off Ver
    Excel 2007
    Posts
    83

    Adding Dates at Different Endpoints

    Hello,

    I have two Excel spreadsheets. One has attendance data from 2010, the other from 2011. I would like to add the attendance dates from 2011 where the dates end in the 2010 file. The endpoint is different for each individual.

    Thank you,
    Ajang
    Attached Files Attached Files
    Last edited by ajang; 11-20-2011 at 11:06 AM.

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Adding Dates at Different Endpoints

    Try this macro

    Please Login or Register  to view this content.
    You will be prompted to click on any cell in each of the two sheets. This is to tell the code which is which.

    Open up the VBA editor by hitting ALT F11

    Insert a new module by hitting Insert - Module

    Paste the macro into the empty sheet

    Hit ALT F11 to get back to the worksheet.

    Run the macro by going to tools-macro in Excel 2003 or the view ribbon in Excel 2007.
    Martin

  3. #3
    Registered User
    Join Date
    10-13-2010
    Location
    Miami, US
    MS-Off Ver
    Excel 2007
    Posts
    83

    Re: Adding Dates at Different Endpoints

    Hi Martin,

    I tried running the Macro. Unfortunately it is not giving me the required result. May be I am not doing it the correct way. So, let me explain what I did. I tried doing it two ways.

    Method 1

    I opened both the spreadsheets. Then I ran the macro in 2011 spreadsheet. In the end it asks me to click on any one cell in 2011 spreadsheet and then in 2010. I could do that because both files were opened side by side.

    It gives me the following error "Run-time error 1004". Application-defined or object-defined error.

    Method 2

    I open only 2011 spreadsheet and run the macro. In this case when it asks me to select any one cell in 2010, I cannot do that because 2011 file is open and until I don't close it; it does not allow me to move to other excel spread sheet and thus I cannot select any cell in 2010.

  4. #4
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Adding Dates at Different Endpoints

    Try this...

    Have both workbooks open. It shouldn't matter which one is currently active.
    Run the macro and use the switch windows button on the View ribbon to move between the sheets.

+ 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