+ Reply to Thread
Results 1 to 10 of 10

search and select rows on user entered text

  1. #1
    Registered User
    Join Date
    01-13-2008
    Posts
    3

    search and select rows on user entered text

    Firstly apologies if this is elsewhere on the site, i did look, i am new to excel and dont really know where to start at all.

    What i am looking to do is search using a user input and select all the rows that contain the entered search text.

    I have 4 sheet workbook, columns are the same accross them all, and what i require is to be able to take a text input from a user, maybe what column to search, and in what sheet. Then search the relevent sheet for matches. Once found the record that contains the match is to be copied to another sheet where filters can e applied. There will be multiple records selected for each search.

    I hope this makes sense.

    Any advice or pointers to decent tutorials or templates would be much appreciated.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    If you press Ctrl + F to pull up the next box you have the option to search workbook.

    But to list the found cells I would suggest installing this useful add-in

    http://www.jkp-ads.com/OfficeMarketPlaceFF-EN.asp

    Enjoy

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    01-13-2008
    Posts
    3

    Smile

    Hi Noob thanks for the interest.

    I think I need to explain a bit clearer thou.

    I have around 15 columns and a couple of hundred rows. I need the user to enter a string, say for example a street name, and the column it’s expected in. The magic spell is cast and all of the rows that have the entered street name in the specified column are output to a new sheet or the other records are filtered out leaving only the qualifying records.

    I have been playing with autofilter’s but there are just too many different values in each column to make this a viable option. I’m guessing some sort of macro or VBA mod.

    Hope this is clearer.

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    The code that I posted here can easily be adapted to your needs

    http://www.excelforum.com/showthread.php?t=629530

    I would also think that Advanced Filter would be an option.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  6. #6
    Registered User
    Join Date
    01-13-2008
    Posts
    3

    Thumbs up

    Thats the very badboy right there! Cheers Noob.

    That’s a bit more elegant and versatile a solution Roy Thanks.

    So if I change the last line to rng2.EntireRow.Copy how do I output the copied rows to say a sheet called Results?
    Last edited by FoeNyne; 01-16-2008 at 07:05 PM.

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Try this

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    09-14-2011
    Location
    Chennai
    MS-Off Ver
    Excel 2000
    Posts
    1

    Re: search and select rows on user entered text

    Please try this code with a slight modification of "royUK" code above, which results in "searched" string arranged by "Exact Word" along with "leading" words.

    Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #3 requires code tags. I have added them for you this time because you are a new member. --6StringJazzer

    Please Login or Register  to view this content.
    Last edited by 6StringJazzer; 06-05-2014 at 02:54 PM.

  9. #9
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: search and select rows on user entered text

    @ tvravic. Did you notice the thread dates?

  10. #10
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,720

    Re: search and select rows on user entered text

    tvravic, please see my note above regarding code tags. Moreover, FoeNyne hasn't posted here for about 6 years so it is unlikely that your contribution will help. I'm not sure what led you to this thread to make your first post but you may want to check dates on threads before spending much effort on them.
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

+ 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