+ Reply to Thread
Results 1 to 9 of 9

Copy, Search, Then Paste Needed

  1. #1
    Registered User
    Join Date
    03-24-2009
    Location
    Louisiana, USA
    MS-Off Ver
    Excel 2003
    Posts
    29

    Copy, Search, Then Paste Needed

    Newbie! I am looking for a macro to assign to a command button that will copy cells in row A2:A10 in worksheet1 based on a criteria (date) giving in cell A1 , then search worksheet2 (column A) for the criteria (date) giving in (Worksheet1! A1) and paste the cells in (Worksheet1! A2:A10) next to the found date in worksheet2.

    I would really appreciate the help.
    Last edited by strato1983; 03-27-2009 at 02:27 PM.

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Copy, Search, Then Paste Needed

    I suggest you attach a small sample workbook illustrating your data and desired results.

  3. #3
    Registered User
    Join Date
    03-24-2009
    Location
    Louisiana, USA
    MS-Off Ver
    Excel 2003
    Posts
    29

    Re: Copy, Search, Then Paste Needed

    Thanks for the fast response!
    Here's a sample. Basically what I need,

    Using a command button
    Copy cells B1:E1 then paste the values to sheet2 next to the date based on cell A1 in sheet1.

    If you change the (criteria) date in A1 than click the command button cells B1:E1 will be copied next to that date, and so on.
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Copy, Search, Then Paste Needed

    OK, that's easily done, but why couldn't you just use the VLOOKUP formula?

    Where are the values in B1:E1 coming from when you change the date?

  5. #5
    Registered User
    Join Date
    03-24-2009
    Location
    Louisiana, USA
    MS-Off Ver
    Excel 2003
    Posts
    29

    Re: Copy, Search, Then Paste Needed

    Sounds like you know your stuff StephenR

    I want the user to ensure that the data in sheet1 is correct before copying the values to sheet2. A command button adds a user step but gives the added security. If that makes any sense.

  6. #6
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Copy, Search, Then Paste Needed

    Sort of, though you could just use data validation. Anyway, try assigning this to a button:
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    03-24-2009
    Location
    Louisiana, USA
    MS-Off Ver
    Excel 2003
    Posts
    29

    Re: Copy, Search, Then Paste Needed

    Wow! That does look easy.
    Now can the same date in sheet1 also be used to copy another set of cells lets say B2:E2 to another set of dates below the first set of dates in sheet2 all with one click of the button? Please see the attached example.
    Attached Files Attached Files

  8. #8
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Copy, Search, Then Paste Needed

    If there is a fixed interval between your two sets of dates:
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    03-24-2009
    Location
    Louisiana, USA
    MS-Off Ver
    Excel 2003
    Posts
    29

    Smile Re: Copy, Search, Then Paste Needed

    I get it! Thanks a bunch StephenR. I'll mark this thread as solved.

+ 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