+ Reply to Thread
Results 1 to 17 of 17

Filtering by list of keywords and pasting results into spreadsheet

  1. #1
    Registered User
    Join Date
    07-11-2009
    Location
    -
    MS-Off Ver
    Excel 2003
    Posts
    46

    Filtering by list of keywords and pasting results into spreadsheet

    Basically I have two Spreadsheets, lets call it Spreadsheet 1 and Spreadsheet 2.

    Spreadsheet 1 has a list of partial employee names in column A.
    Spreadsheet 2 has a list of 500,0000 full employee names in column A and their phone number in column B and address in column C through E.

    Basically what I want to do is do a wildcard search for the partial employee name, so like lookup Spreadsheet 1' Column A's *name* in column A of Spreadsheet 2. Based on the number of matches. I want to insert that many blank rows underneath the partial employee name, and paste those matched rows there, then continue to the second partial employee name lookup and repeat the process.

    This loop has to repeat 1000 times.

    I would appreciate help very much.
    Last edited by ej463; 08-19-2009 at 07:43 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Filtering by list of keywords and pasting results into spreadsheet

    Post a workbook with a useful amount of DUMMY data.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    07-11-2009
    Location
    -
    MS-Off Ver
    Excel 2003
    Posts
    46

    Re: Filtering by list of keywords and pasting results into spreadsheet

    Thank you for taking the time to respond to me once again, it is most appreciated. I have attached the spreadsheet. Sheet 3 shows how I want the data to look using the partial names from spreadsheet 1. I made a slight adjustment, where I would like in the output in sheet 3 ,the partial employee name next to each row of data that is extracted from sheet 2 (which is associated to that partial name), this row consists of about 7 or 8 cells if that makes it easier. I think it will be clearer if you look at the spreadsheet.

    Thanks again.
    Attached Files Attached Files
    Last edited by ej463; 08-19-2009 at 08:08 PM.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Filtering by list of keywords and pasting results into spreadsheet

    Try this -- code goes in the Sheet1 module.
    Please Login or Register  to view this content.
    Last edited by shg; 08-20-2009 at 10:28 AM.

  5. #5
    Registered User
    Join Date
    07-11-2009
    Location
    -
    MS-Off Ver
    Excel 2003
    Posts
    46

    Re: Filtering by list of keywords and pasting results into spreadsheet

    Hello, it works, but the problem is that I need the partial name in the cell next to the full employee name, in the output. this way I can tell which phrase each full employee name is associated to. Basically when I run the macros it places the full employee names under the partial name in Sheet 1. I would like instead to shift the full employee name to the right by one cell. And in that cell it was initially in have the partial employee name that is associated to.

  6. #6
    Registered User
    Join Date
    07-11-2009
    Location
    -
    MS-Off Ver
    Excel 2003
    Posts
    46

    Re: Filtering by list of keywords and pasting results into spreadsheet

    you might see what I mean in sheet 3 of the attached spreadsheet i posted above. thank you very much so far for the help

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Filtering by list of keywords and pasting results into spreadsheet

    Try this.
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    07-11-2009
    Location
    -
    MS-Off Ver
    Excel 2003
    Posts
    46

    Re: Filtering by list of keywords and pasting results into spreadsheet

    Thanks! That works great.

    I have one more question.
    I would like to speed the process up, I was wondering if rather than going into Sheet 2 and getting each employee row associated to the partial employee name one by one. If it would be possible to filter Sheet 2 by the partial employee name, and cut and paste all those in one swoop into Sheet 1. The output would be the same as the macros you supplied above. I just believe it would speed things up significantly since there are about 600,000 records in Sheet 2 and 3000 partial names in Sheet 1.

    Thanks shg for your help

  9. #9
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Filtering by list of keywords and pasting results into spreadsheet

    Sure, that would be another approach.

    Turning screenupdating off during execution would speed the existing code.

  10. #10
    Registered User
    Join Date
    07-11-2009
    Location
    -
    MS-Off Ver
    Excel 2003
    Posts
    46

    Re: Filtering by list of keywords and pasting results into spreadsheet

    Sorry, do you think you can provide me with an altered code that can do that?

  11. #11
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Filtering by list of keywords and pasting results into spreadsheet

    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    07-11-2009
    Location
    -
    MS-Off Ver
    Excel 2003
    Posts
    46

    Re: Filtering by list of keywords and pasting results into spreadsheet

    Sorry again to bother shg, its the filtering, and then cutting and pasting that I was referring to.

  13. #13
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Filtering by list of keywords and pasting results into spreadsheet

    Add a row above and a column to the left of your data on sheet2.
    Please Login or Register  to view this content.

  14. #14
    Registered User
    Join Date
    07-11-2009
    Location
    -
    MS-Off Ver
    Excel 2003
    Posts
    46

    Re: Filtering by list of keywords and pasting results into spreadsheet

    Hello, So basically Im working with the macros you posted at 8:26 pm on 8/21 because that works great, the last one posted I encountered problems with, which is fine I can stick with the older one.

    I have a question regarding the older macros because when I run it, my memory usage on task manager is at 300,000K for excel and then once I start the macros it increases every second by 1k until it reaches 1,700,000K and then the excel program freezes and it says it is out of memory even though I have 2gb of ram in my computer. Im not sure why the memory usage for this macros increases, shouldnt it remain constant because the same task is being repeated?

    Also that macros works correctly, although slow, the output is correct, so I will use it. However, I dont want to keep restarting excel due to the memory usage error. I would like to just run the macros overnight and see the output in the morning. Thanks

  15. #15
    Registered User
    Join Date
    07-11-2009
    Location
    -
    MS-Off Ver
    Excel 2003
    Posts
    46

    Re: Filtering by list of keywords and pasting results into spreadsheet

    I also encounter this random error sometimes where it just copies and pastes the same name over and over again in the output. It happens at random points while running the Macros. If i rerun the Macros this happens again but at different points. Its a strange problem

  16. #16
    Registered User
    Join Date
    07-11-2009
    Location
    -
    MS-Off Ver
    Excel 2003
    Posts
    46

    Re: Filtering by list of keywords and pasting results into spreadsheet

    Actually I figured out the problem on my own but I need to make a minor edit to the code for the macros posted at 8:26pm on 8/21 by shg.

    Basically, I need the workbook saved after it looks up 20 or so employee names.
    This resets the memory usage.

    All I need help with is incorporating in the code posted on 8:26pm on 8/21 by shg a way to save the workbook after it looks up 20 employee name keywords.

    Thank you

  17. #17
    Registered User
    Join Date
    07-11-2009
    Location
    -
    MS-Off Ver
    Excel 2003
    Posts
    46

    Re: Filtering by list of keywords and pasting results into spreadsheet

    Sorry for posting so much, Please ignore my previous 2 posts. I figured out another workaround, and I believe its a quick edit to this code, I just have no idea how to do it. The problem with my computer is after maybe 10 or 20 minutes of running the macros it freezes up. Then I have to copy whatever output that was completed at the bottom of sheet 1 into another sheet so that I can restart the Macros again. Otherwise it will start looking up values from the bottom of the sheet again and going up, when some of the values were already looked up. Basically I just want this Macros to resume from the place it stopped at when I press run macros the second or third time. So right above the last line of output it procured from sheet 2.

    This is the macros I am using which shg created, you can use it with the excel worksheet posted in my third post.

    I really would appreciate help, because after this gets figured out Im done with this project, and I believe it shouldnt a complicated edit to the below macros.

    Kind Regards.

    Please Login or Register  to view this content.

+ 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