+ Reply to Thread
Results 1 to 16 of 16

Finding a word string in a column of ~160,000 rows

  1. #1
    Forum Contributor
    Join Date
    11-22-2006
    MS-Off Ver
    2010
    Posts
    201

    Finding a word string in a column of ~160,000 rows

    Hello all,
    I have a data dump which contains column containing sentences and word fragments.

    Is there a way, using VBA, which will allow me to search this data and return the items found in another sheet as a distinct set of sentences?
    So for example:

    row Column B
    2 She said this
    3 He wasnt available
    4 Lucy was involved and available.

    It would be great if the macro would prompt the user to enter the word string they are interested in and then return the results in another page.
    So entering Lucy would return row 4 only.
    And entering Lucy and available would provide row 3 and 4.

    Thanks so much for your help
    Lucy

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Finding a word string in a column of ~160,000 rows

    Hi Lucy,

    how would the search criteria be entered?
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Forum Contributor
    Join Date
    11-22-2006
    MS-Off Ver
    2010
    Posts
    201

    Re: Finding a word string in a column of ~160,000 rows

    Hi Arkadi, via a message box, so you would be invited to enter a string and it would use that in the search.
    Thank you!

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Finding a word string in a column of ~160,000 rows

    Have you looked at AutoFilter and its Contains option?
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  5. #5
    Forum Contributor
    Join Date
    11-22-2006
    MS-Off Ver
    2010
    Posts
    201

    Re: Finding a word string in a column of ~160,000 rows

    yes, but its slow considering the volume of rows
    hence my request for help with a vba option - thanks!
    Lucy

  6. #6
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,210

    Re: Finding a word string in a column of ~160,000 rows

    I think it will be slow, but will be surprised if you find anything quicker

  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: Finding a word string in a column of ~160,000 rows

    How about Find > Find All?
    Entia non sunt multiplicanda sine necessitate

  8. #8
    Forum Contributor
    Join Date
    11-22-2006
    MS-Off Ver
    2010
    Posts
    201

    Re: Finding a word string in a column of ~160,000 rows

    hello everyone, is this possible using VBA? sorry to ask again.

    Thank for any help.

  9. #9
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Finding a word string in a column of ~160,000 rows

    Can you provide an example file we can work with ?
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  10. #10
    Forum Contributor
    Join Date
    11-22-2006
    MS-Off Ver
    2010
    Posts
    201

    Re: Finding a word string in a column of ~160,000 rows

    hi , see attached file. For example you would search the text for words like "brain". And it would return the results to the Results worksheet together with the numbers from col2, col3 and total.

    thank you again.
    Attached Files Attached Files

  11. #11
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Finding a word string in a column of ~160,000 rows

    Please Login or Register  to view this content.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  12. #12
    Forum Contributor
    Join Date
    11-22-2006
    MS-Off Ver
    2010
    Posts
    201

    Re: Finding a word string in a column of ~160,000 rows

    Hi ,thanks for your reply

    It doesnt seem to be working however, if I type in Ablation for example it gives me row numbers which dont contain ablation.
    Infact it always gives the same numbers.

    Also, would it be possible for the results to be saved in the "Results" sheet, so a copy of each row in the Data sheet which contains a word or string of words entered in the message box.

    Hope that is ok.
    Thanks very much.
    Lucy

  13. #13
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Finding a word string in a column of ~160,000 rows

    Please Login or Register  to view this content.

  14. #14
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Finding a word string in a column of ~160,000 rows

    Let's start with 1 searchword.

    Please Login or Register  to view this content.
    Last edited by bakerman2; 10-29-2017 at 01:30 PM.

  15. #15
    Forum Contributor
    Join Date
    11-22-2006
    MS-Off Ver
    2010
    Posts
    201

    Re: Finding a word string in a column of ~160,000 rows

    thank you both, this is great !

  16. #16
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Finding a word string in a column of ~160,000 rows

    You're welcome.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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] Finding a word in a string
    By supremenuts in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-28-2017, 03:28 PM
  2. Replies: 16
    Last Post: 04-10-2016, 07:51 AM
  3. Finding a word in String and pasting sequence A,B,C...
    By prat123 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-07-2015, 11:04 AM
  4. Replies: 1
    Last Post: 09-11-2014, 10:59 AM
  5. VBA to enter a word, find said word in string of column & copy to another column
    By tuneloon in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-29-2012, 11:59 AM
  6. finding rows that contain a data string across mutiple columns
    By always_confused in forum Excel General
    Replies: 4
    Last Post: 06-11-2012, 06:53 AM
  7. Finding the final word in a string
    By IainT in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-01-2007, 08:12 AM

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