+ Reply to Thread
Results 1 to 5 of 5

Button that will copy cell to different workbook into rows with same ID

  1. #1
    Registered User
    Join Date
    11-26-2013
    Location
    Manila, Philippines
    MS-Off Ver
    Excel 2013
    Posts
    21

    Question Button that will copy cell to different workbook into rows with same ID

    Good day, everyone.

    Is there a way to copy the contents of a column to a column of a different workbook, making sure to copy each cell into the row that matches the ID on the source workbook?

    For example, in the attached Sample_Source file, I need the data on Column B (Overall) to be transferred to Column E (info) of the Sample_Destination file. The ID number needs to be matched before the copying takes place. For example, in the samples, B2 in Sample_Source should go to E17 in Sample_Destination. E17, after pressing button, will now display 4.

    After that, the contents (except headings) of the Sample_Source file should be deleted.
    The next time someone inputs data in Sample_Source, the button will do the same thing and look up the new ID numbers and add their Info to the same Sample_Destination file. All ID numbers are unique. The number of rows with contents that need to be transferred varies from time to time.
    The button should be in the Sample_Source file.

    Is this possible to do via VBA?

    Thank you for reading!

    Sample_Destination.xlsx
    Sample_Source.xlsx
    Last edited by michaljireht; 12-04-2014 at 04:18 AM.

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Button that will copy cell to different workbook into rows with same ID

    Hi michaljireht

    Do you wish ONLY the Matches to be deleted from Sample_Source or should ALL Data be deleted, regardless of a Match?
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  3. #3
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Button that will copy cell to different workbook into rows with same ID

    Hi michaljireht

    This Code is in the attached Sample_Source Workbook. Sample_Destination can be open or closed. If closed the Code will open it. For testing purposed place both Workbooks in the SAME Folder. ALL Data is cleared from the Sample_Source File.

    Let me know of issues.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by jaslake; 12-04-2014 at 12:37 PM.

  4. #4
    Registered User
    Join Date
    11-26-2013
    Location
    Manila, Philippines
    MS-Off Ver
    Excel 2013
    Posts
    21

    Re: Button that will copy cell to different workbook into rows with same ID

    It worked beautifully! Thank you!

    Is there a way to delete only the matches in the Source Sheet, like you mentioned in an earlier reply?

    Thanks!

  5. #5
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Button that will copy cell to different workbook into rows with same ID

    Hi michaljireht

    Sure, this can be done
    Is there a way to delete only the matches in the Source Sheet
    Create a Sample File that exhibits no matches and upload it. The Code will take a bit of rewrite and I'll need something to test the Code.

+ 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. Replies: 12
    Last Post: 07-29-2014, 01:06 PM
  2. Copy rows into a Workbook sheet based on cell value
    By CRS111 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-09-2014, 02:32 PM
  3. Replies: 2
    Last Post: 11-12-2013, 08:42 PM
  4. VBA to open all worksheet in workbook and copy rows if cell contains a value
    By birdi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-23-2013, 11:15 AM
  5. Copy cell color of rows in 1 workbook to those rows in another workbook
    By pacciari in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-12-2012, 06:10 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