+ Reply to Thread
Results 1 to 10 of 10

Query, copy & paste

  1. #1
    Registered User
    Join Date
    01-31-2006
    Location
    Washington State
    Posts
    10

    Question Query, copy & paste

    Hey there,

    I'm trying to extract key data from a spreadsheet in this way: the spreadsheet has cells in different columns which may have matching data. I want Excel to find these matching cells and copy the rows in which they reside onto a second sheet.

    For example:

    The first column in question is a listing of Service Orders. I want Excel to search the second column in question, Purchase Orders, for a match. When a match or matches are found I want any row containing that info to be presented on the second spreadsheet.

    The example is probably redundant, but hopefully stating it slightly differently will help illuminate my goal.

    Thanks in advance,

    Nate

  2. #2
    Dave Peterson
    Guest

    Re: Query, copy & paste

    Life is usually much simpler if you keep your data in one location.

    I'd just use one worksheet, but then apply Data|Filter|Autofilter to see the
    rows I want to see.

    But if you really, really want...

    Debra Dalgleish and Ron de Bruin have samples that you may like. Ron's addin
    may be sufficient right out of the box.

    Debra's site:
    http://www.contextures.com/excelfiles.html

    Create New Sheets from Filtered List -- uses an Advanced Filter to create
    separate sheet of orders for each sales rep visible in a filtered list; macro
    automates the filter. AdvFilterRepFiltered.xls 35 kb

    or

    Update Sheets from Master -- uses an Advanced Filter to send data from
    Master sheet to individual worksheets -- replaces old data with current.
    AdvFilterCity.xls 55 kb

    And Ron de Bruin's easyfilter.
    http://www.rondebruin.nl/easyfilter.htm

    ThalesNate wrote:
    >
    > Hey there,
    >
    > I'm trying to extract key data from a spreadsheet in this way: the
    > spreadsheet has cells in different columns which may have matching
    > data. I want Excel to find these matching cells and copy the rows in
    > which they reside onto a second sheet.
    >
    > For example:
    >
    > The first column in question is a listing of Service Orders. I want
    > Excel to search the second column in question, Purchase Orders, for a
    > match. When a match or matches are found I want any row containing
    > that info to be presented on the second spreadsheet.
    >
    > The example is probably redundant, but hopefully stating it slightly
    > differently will help illuminate my goal.
    >
    > Thanks in advance,
    >
    > Nate
    >
    > --
    > ThalesNate
    > ------------------------------------------------------------------------
    > ThalesNate's Profile: http://www.excelforum.com/member.php...o&userid=31037
    > View this thread: http://www.excelforum.com/showthread...hreadid=507028


    --

    Dave Peterson

  3. #3
    Registered User
    Join Date
    01-31-2006
    Location
    Washington State
    Posts
    10

    Maybe a pic...

    Dave,

    I don't think a filter will work because I'm trying to compare data from separate columns. I did take a peek at Debra's link but there's a lot of data there and it's hard to discern what pertains to me. Ron's link was down at the time, but I'll check it later.

    I'm including a pic this time to better illustrate my needs, I want Excel to find any data in the "Customer PO" column beginning with a "20" and search the "Order Number" column to find the match. Can filtering do this?

    Thanks for your feedback,

    Nate
    Attached Images Attached Images

  4. #4
    Dave Peterson
    Guest

    Re: Query, copy & paste

    Since I connect the newsgroups directly, I can't see the picture.

    You'll usually get more responses if you post in plain text--lots of people skip
    by posts with attachments (pictures or excel files).



    ThalesNate wrote:
    >
    > Dave,
    >
    > I don't think a filter will work because I'm trying to compare data
    > from separate columns. I did take a peek at Debra's link but there's a
    > lot of data there and it's hard to discern what pertains to me. Ron's
    > link was down at the time, but I'll check it later.
    >
    > I'm including a pic this time to better illustrate my needs, I want
    > Excel to find any data in the "Customer PO" column beginning with a
    > "20" and search the "Order Number" column to find the match. Can
    > filtering do this?
    >
    > Thanks for your feedback,
    >
    > Nate
    >
    > +-------------------------------------------------------------------+
    > |Filename: ExcelExample.GIF |
    > |Download: http://www.excelforum.com/attachment.php?postid=4293 |
    > +-------------------------------------------------------------------+
    >
    > --
    > ThalesNate
    > ------------------------------------------------------------------------
    > ThalesNate's Profile: http://www.excelforum.com/member.php...o&userid=31037
    > View this thread: http://www.excelforum.com/showthread...hreadid=507028


    --

    Dave Peterson

  5. #5
    Registered User
    Join Date
    01-31-2006
    Location
    Washington State
    Posts
    10

    Red face n00b help

    Thanks for the tip...

    Basically, the details are thus:

    Service Order : Purchase Order
    2016500 <---| SO-56137
    2016501 | 20273896054
    2016502 |---> 2016500


    I need Excel to associate the first and third lines by associating cells that share neither a common row nor column, can filtering do that?

    Thanks (again)

    Nate

  6. #6
    Dave Peterson
    Guest

    Re: Query, copy & paste

    Not easily and depending on your data--maybe not at all.

    Is there anyway you can put the common stuff in a dedicated column--and on each
    row?

    ThalesNate wrote:
    >
    > Thanks for the tip...
    >
    > Basically, the details are thus:
    >
    > _*Service_Order___:_______Purchase_Order__*_
    > -*2016500 <---| -*SO-56137
    > 2016501 | 20273896054
    > 2016502 -* |---> 2016500- *
    >
    > I need Excel to associate the first and third lines by associating
    > cells that share neither a common row nor column, can filtering do
    > that?
    >
    > Thanks (again)
    >
    > Nate
    >
    > --
    > ThalesNate
    > ------------------------------------------------------------------------
    > ThalesNate's Profile: http://www.excelforum.com/member.php...o&userid=31037
    > View this thread: http://www.excelforum.com/showthread...hreadid=507028


    --

    Dave Peterson

  7. #7
    Registered User
    Join Date
    01-31-2006
    Location
    Washington State
    Posts
    10
    Well...there's a lot of each data and most items don't match, that's why I thought query would be the best route initially, like maybe a do-loop using VBA.

  8. #8
    Dave Peterson
    Guest

    Re: Query, copy & paste

    So if column B contains a po--any po in column A, then copy that single row to a
    different location???

    You could insert a new column (C?)
    and use:

    =isnumber(match(b1,a:a,0))

    And drag down.

    Then filter to show just the trues and copy those rows.

    But I'm not sure how that matches up with what you want.

    You may want to try explaining it once more.



    ThalesNate wrote:
    >
    > Well...there's a lot of each data and most items don't match, that's why
    > I thought query would be the best route initially, like maybe a do-loop
    > using VBA.
    >
    > --
    > ThalesNate
    > ------------------------------------------------------------------------
    > ThalesNate's Profile: http://www.excelforum.com/member.php...o&userid=31037
    > View this thread: http://www.excelforum.com/showthread...hreadid=507028


    --

    Dave Peterson

  9. #9
    Registered User
    Join Date
    01-31-2006
    Location
    Washington State
    Posts
    10

    Talking

    Dave,

    That's doing something, which is a start. It's flaky, though, when I re-sort I have to re-drag so it will reference the correct cell because it likes to shift down a cell. Hard to explain.

    Anyway, I'll monkey with it in my free time tomorrow, hopefully I can get it to make sense. I appreciate you taking the time to make me some code, though.

    Regards,

    Nate

  10. #10
    Registered User
    Join Date
    01-31-2006
    Location
    Washington State
    Posts
    10

    Thumbs up Good start!

    Dave,

    I used your code to isolate the data I need. Good stuff! Now it comes down to re-organizing the pertinent data...
    I used the code to generate 2 different spreadsheets: =ISNUMBER(MATCH(B1,F:F,0)) and =ISNUMBER(MATCH(F1,B:B,0)). Now I need to put the resulting info together, like shuffling a deck of cards.

    For example:

    Line 1, spreadsheet 1
    Line 1, spreadsheet 2
    Line 2, spreadsheet 1
    Line 2, spreadsheet 2
    Line 3, spreadsheet 1
    Line 3, spreadsheet 2
    Line 4, spreadsheet 1
    Line 4, spreadsheet 2

    ...and so on, until both spreadsheets are completely merged. Does that sound possible?
    Last edited by ThalesNate; 02-02-2006 at 10:47 PM.

+ 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