+ Reply to Thread
Results 1 to 25 of 25

Extract Every Instance of Entry to Another Sheet

  1. #1
    Registered User
    Join Date
    08-28-2014
    Location
    NJ
    MS-Off Ver
    2010
    Posts
    50

    Extract Every Instance of Entry to Another Sheet

    You'll see this much better in the sample sheet. I wish to do the following:

    In sheet "ThisWeek", I want to look up each entry of Column T (Horse) in sheet "ALL". I then want copy EVERY instance (and the entire row of data) of that entry into sheet "Extracted." Now, I gave just a smattering of the info. The real sheets go up to column JF. I'm not sure that matters. And yes the sheets have a header so the search/paste will have to begin at A2. Also, I want the data to pile up of course and not overwrite. Meaning, I could have a list of 100 horses that could return over 1000 matches. I want that list of over 1000 to appear in the Extracted sheet. I hope explained this clearly. I'm tired. Please help!
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Extract Every Instance of Entry to Another Sheet

    Are there any duplicate Horse names in Column T of the "ALL" sheet?

    Here's one way to attack it:

    1. Loop through your list of Horse names in Column T of Sheet "ALL" and autofilter your data in Sheet "ThisWeek" using each horse name as the autofilter criteria.

    2. Within the loop.. each time the autofilter gets applied with the next autofilter criteria(horse name).. copy the visible rows after autofilter to the next unused row in your "Extracted" sheet.

    Make sense?

  3. #3
    Registered User
    Join Date
    08-28-2014
    Location
    NJ
    MS-Off Ver
    2010
    Posts
    50

    Re: Extract Every Instance of Entry to Another Sheet

    Yes, there are duplicate names in the ALL sheet.

  4. #4
    Registered User
    Join Date
    08-28-2014
    Location
    NJ
    MS-Off Ver
    2010
    Posts
    50

    Re: Extract Every Instance of Entry to Another Sheet

    I do believe I understand what you're saying. However, I do not have the knowledge to pull that off. LOL Hence...here I am! I know, I know. I'm sorry.

  5. #5
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Extract Every Instance of Entry to Another Sheet

    k.. that's no problem.. I would add a step just before step 1 above that goes like:

    * Loop through all the Values in Column T and add each Horse name to a Dictionary (Scripting Dictionary) and then you can use each Key of that Dictionary .. (which will be a Unique value (horse name)) as your autofilter criteria in that loop i mentioned..

    Do you need further help with any/all or none of the plan of attack i am suggesting?

    Edit: k. just saw your last post.. I will, time permitting, make something now..

  6. #6
    Registered User
    Join Date
    08-28-2014
    Location
    NJ
    MS-Off Ver
    2010
    Posts
    50

    Re: Extract Every Instance of Entry to Another Sheet

    I'm trying to pull off something with an IF function. No luck. I could sort it manually after that and get what I want. But....LOL... wellllllllllllll

  7. #7
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Extract Every Instance of Entry to Another Sheet

    Hi..

    Try this..

    Please Login or Register  to view this content.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    08-28-2014
    Location
    NJ
    MS-Off Ver
    2010
    Posts
    50

    Re: Extract Every Instance of Entry to Another Sheet

    It works in this instance. But not on the big sheet. The sheet it's from goes up to JF (which is what, 266?). Could that be why it doesn't work?

  9. #9
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Extract Every Instance of Entry to Another Sheet

    Yeap.. I made it work for the Workbook you attached.. you need to adapt it to your own Workbook.. there's not much that needs changing..

    I will make the things that need changing be Red in font below... have a go at adapting it and see how you go..

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    08-28-2014
    Location
    NJ
    MS-Off Ver
    2010
    Posts
    50

    Re: Extract Every Instance of Entry to Another Sheet

    The problem is the file is too big to upload. Maybe the parameters need to tweaked for it go to to JF? It comes up with an error on the big sheet.

  11. #11
    Registered User
    Join Date
    08-28-2014
    Location
    NJ
    MS-Off Ver
    2010
    Posts
    50

    Re: Extract Every Instance of Entry to Another Sheet

    ahhhhhhhhhh okay. Thank you. I shall try right now.

  12. #12
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Extract Every Instance of Entry to Another Sheet

    You could always upload the file to dropbox or mediafire or similar..

    Having said that.. did you look at what I posted in Post #9.. I changed the values(parameters) that need changing to be Bold Red font..

    Edit: I see that you see that now..

  13. #13
    Registered User
    Join Date
    08-28-2014
    Location
    NJ
    MS-Off Ver
    2010
    Posts
    50

    Re: Extract Every Instance of Entry to Another Sheet

    comes up with this error: Subscript out of range. Here is the debug

    Sheets("ThisWeek").AutoFilter.Range.Offset(1, 0).Resize(Sheets("ThisWeek").AutoFilter.Range.Rows.Count - 1, 266).SpecialCells(12).Copy _
    Sheets("Extracted").Range("A" & Sheets("Extracted").Range("A" & Rows.Count).End(xlUp).Row + 1)

  14. #14
    Registered User
    Join Date
    08-28-2014
    Location
    NJ
    MS-Off Ver
    2010
    Posts
    50

    Re: Extract Every Instance of Entry to Another Sheet

    I do see a mistake on my part. I named the sheet Extract and not Extracted. Be right back

  15. #15
    Registered User
    Join Date
    08-28-2014
    Location
    NJ
    MS-Off Ver
    2010
    Posts
    50

    Re: Extract Every Instance of Entry to Another Sheet

    It's running and no error has popped up. So far so good. "ALL" is kind of huge. Almost 30,000 entries. This may take awhile. I didn't shut off conditional formatting either.

  16. #16
    Registered User
    Join Date
    08-28-2014
    Location
    NJ
    MS-Off Ver
    2010
    Posts
    50

    Re: Extract Every Instance of Entry to Another Sheet

    I stopped it. It came up with Object Filter of Auto Range Failed.

  17. #17
    Registered User
    Join Date
    08-28-2014
    Location
    NJ
    MS-Off Ver
    2010
    Posts
    50

    Re: Extract Every Instance of Entry to Another Sheet

    Method AutoFilter of Object Range Failed.............that's what I get.

  18. #18
    Registered User
    Join Date
    08-28-2014
    Location
    NJ
    MS-Off Ver
    2010
    Posts
    50

    Re: Extract Every Instance of Entry to Another Sheet

    This Error came up after I close it down manually. It stops responding. Method Auto Filter of Oject Range Failed

  19. #19
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Extract Every Instance of Entry to Another Sheet

    Try the attached.
    Attached Files Attached Files

  20. #20
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Extract Every Instance of Entry to Another Sheet

    Go for AB33's solution.. his scripting dictionary and array based solution will be much faster on that amount of data..

  21. #21
    Registered User
    Join Date
    08-28-2014
    Location
    NJ
    MS-Off Ver
    2010
    Posts
    50

    Re: Extract Every Instance of Entry to Another Sheet

    I keep trying to post something more but it won't go. Test Test Test

  22. #22
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Extract Every Instance of Entry to Another Sheet

    It appears that the site has attacked by virus. I am unable to open page 2 if the thread goes to next page.

  23. #23
    Registered User
    Join Date
    08-28-2014
    Location
    NJ
    MS-Off Ver
    2010
    Posts
    50

    Re: Extract Every Instance of Entry to Another Sheet

    AB33, you have it set up to paste as far as column AO. I need it to go as far as JF. Also, you have it to autofit in the columns. I would like it to paste the way it is. And last and far from least........it's not pasting every instance of the horse from this week. It's pasting only the one from ThisWeek. I need each and every instance from ALL (including the one in ThisWeek).

  24. #24
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Extract Every Instance of Entry to Another Sheet

    There is auto fit on the code

    Please Login or Register  to view this content.
    If you do not want it, remove the line.
    The code goes as far as any column you wish subject to Excel's columns limit.
    If the code stops at column AO, not JF, it is because you have a complete blank column after column AO. I used current region for a range. Current region does not line a complete blank row or column.
    I do not understand the other questions you have. You need to attach a desired output.

  25. #25
    Registered User
    Join Date
    08-28-2014
    Location
    NJ
    MS-Off Ver
    2010
    Posts
    50

    Re: Extract Every Instance of Entry to Another Sheet

    I made a new worksheet. Here it is. Can you get every instance of it from 'ALL'? Can you also make it so there can be blanks within it?
    Attached Files Attached Files

+ 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] Extract numbers before first instance of text
    By pauldaddyadams in forum Excel General
    Replies: 5
    Last Post: 08-12-2014, 07:34 AM
  2. [SOLVED] Combining two sets of data, showing one instance of each entry
    By andrewc in forum Excel General
    Replies: 2
    Last Post: 10-30-2013, 11:57 AM
  3. VLOOKUP for last instance of duplicate entry
    By Enigmatise_1981 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-18-2013, 05:41 AM
  4. Replies: 8
    Last Post: 05-19-2012, 03:26 PM
  5. How to Extract Text Before Second Instance of a Symbol
    By lionsdeal in forum Excel General
    Replies: 2
    Last Post: 08-04-2009, 02:28 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