+ Reply to Thread
Results 1 to 4 of 4

Macro to compare columns in 2 worksheets and paste to 3rd worksheet

  1. #1
    Registered User
    Join Date
    10-28-2010
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    2

    Macro to compare columns in 2 worksheets and paste to 3rd worksheet

    Hello,

    I've been trying to come up with a macro to suit my need but haven't been able to figure it out. This is what I am trying to do:

    1. I can create a spreadsheet from a database that lists all action items from various reviews. This spreadsheet cannot be edited but can be refreshed at any point in time to update the action item status.

    2. I created a new blank worksheet in this workbook and filled in various review numbers that I care about [Column A].

    3. The original spreadsheet with action items contains the action item numbers in one column which contain the review number within them [Column B]. So for review number AI-R5-2010-584659 the original spreadsheet would have all action items listed by AI-R5-2010-584659-01, AI-R5-2010-584659-02, etc.

    4. I want to create a macro that compares the review number portion of the action item number in Column B of "Sheet1" to the review number in "Sheet2" and then copy all matching rows from "Sheet1" to a new worksheet [Sheet 3].

    5. Additionally, I would like to copy the header row in Sheet1 to Sheet3 as well.

    If I can automate this process it will be of great help for the future.

    Hopefully this all makes sense and thanks for the help!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Macro to compare columns in 2 worksheets and paste to 3rd worksheet

    Hi

    See how this goes.
    Please Login or Register  to view this content.
    rylo

  3. #3
    Registered User
    Join Date
    10-28-2010
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Macro to compare columns in 2 worksheets and paste to 3rd worksheet

    Awesome! This worked just as expected.

    I added a few things to the code to make it a little more functional. The only other thing I would like to do is make all of the headers drop down lists in the "Project Action Items" worksheet. Any ideas?

    Here is the code I have:

    Please Login or Register  to view this content.
    Thanks!
    Last edited by jsticca; 10-29-2010 at 01:48 PM.

  4. #4
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Macro to compare columns in 2 worksheets and paste to 3rd worksheet

    Hi

    How about an autofilter.

    Please Login or Register  to view this content.
    rylo

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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