+ Reply to Thread
Results 1 to 6 of 6

Copy Paste Based on Date

  1. #1
    Registered User
    Join Date
    07-11-2014
    Location
    Washington
    MS-Off Ver
    unsure
    Posts
    7

    Copy Paste Based on Date

    I just asked a similar question but I think I can simplify my question.

    I have two sheets, Sheet 1 and Sheet 2. Both have two columns in column A on both sheets is a date. I want to copy the data in column B on sheet 1 and paste it in column B in sheet 2 if it matches the date from Sheet 1. I am new to Macros and would love some advice on this. Thanks!

  2. #2
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,523

    Re: Copy Paste Based on Date

    Hi RedMug,

    You can do this without the need f a macro, ie assuming the data starts at row 2, put this formula into cell B2 of Sheet2...

    =IFERROR(VLOOKUP(A2,Sheet1!A:B,2,FALSE),"")

    ...and copy down as far as required.

    HTH

    Robert
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  3. #3
    Registered User
    Join Date
    07-11-2014
    Location
    Washington
    MS-Off Ver
    unsure
    Posts
    7

    Re: Copy Paste Based on Date

    Thank you very much for the response Trebor76,

    I had to change the A2 to A:A to get the formula to run correctly. But that did the trick and the formula works. However I have hit a snag with it. Sheet 1 gets its data from a web source so it is deleted and pulled again from the webpage daily. (this just allows for todays data to be uploaded to the existing running list)

    My problem is the formula you gave me breaks when the data is deleted. I the error below happens. Any suggestions?

    =IFERROR(VLOOKUP(A:A,'Sheet1'!#REF!,2,FALSE),"")

  4. #4
    Registered User
    Join Date
    07-11-2014
    Location
    Washington
    MS-Off Ver
    unsure
    Posts
    7

    Re: Copy Paste Based on Date

    I got around the REF# error by Copying Sheet1 after the data pull and Pasting by Values onto a third sheet then running the formula off of the third sheet.

  5. #5
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,523

    Re: Copy Paste Based on Date

    I had to change the A2 to A:A to get the formula to run correctly.
    That surprises me as you can't pass an entire column as the value argument for a VLOOKUP function

    Remove the IFERROR function and see what what happens.

    Robert

  6. #6
    Registered User
    Join Date
    07-11-2014
    Location
    Washington
    MS-Off Ver
    unsure
    Posts
    7

    Re: Copy Paste Based on Date

    It's ok the A:A works just fine for the formula.

+ 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. [SOLVED] copy data from the last tab (based on the name with date) and paste it into another tab
    By marreco in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-06-2013, 03:33 PM
  2. Copy/Paste based on Date Range
    By smmeader in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-13-2012, 09:24 AM
  3. Copy Paste row from one worksheet to another based on DATE
    By niketmohan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-21-2011, 08:29 AM
  4. Copy row based on date and then paste into a new worksheet based on section number
    By calmlaunch in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-25-2011, 11:40 PM
  5. Copy-Paste based on date in cell
    By yunesm in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-28-2009, 04:18 PM

Tags for this Thread

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