+ Reply to Thread
Results 1 to 17 of 17

Retrieve data based on a search word

  1. #1
    Registered User
    Join Date
    04-21-2015
    Location
    Florida, USA
    MS-Off Ver
    2010
    Posts
    20

    Retrieve data based on a search word

    I am trying to create a searchable directory. Tab 1 is a the search page. Tab 2 holds all data
    Idea is to type in a word in the search box (B2) and it searches Column A on Tab 2 and returns all rows with that contain that search word. I have removed phone numbers and some data from the form for privacy sake, but for instance you want to search for the word "tax"....it would give copy the rows from tab 2 and return them on tab 1. I would hide the data tab while this is being used so no one can accidentally erase/change anything.

    Any help is appreciated!

    FOPS Master Phone List- DATA removed.xlsx

  2. #2
    Registered User
    Join Date
    12-10-2015
    Location
    Winnipeg
    MS-Off Ver
    2013
    Posts
    18

    Re: Retrieve data based on a search word

    A question, do you want the previous search data from tab 1 cleared when a new search starts?

  3. #3
    Registered User
    Join Date
    12-10-2015
    Location
    Winnipeg
    MS-Off Ver
    2013
    Posts
    18

    Re: Retrieve data based on a search word

    The following can be added to your Search sheet macros in the IDE
    Please Login or Register  to view this content.
    Last edited by TheWrapperGuy; 12-23-2015 at 04:15 PM.

  4. #4
    Registered User
    Join Date
    04-21-2015
    Location
    Florida, USA
    MS-Off Ver
    2010
    Posts
    20

    Re: Retrieve data based on a search word

    sorry, see response below
    Last edited by tnsvolley; 12-23-2015 at 04:27 PM.

  5. #5
    Registered User
    Join Date
    04-21-2015
    Location
    Florida, USA
    MS-Off Ver
    2010
    Posts
    20

    Re: Retrieve data based on a search word

    Quote Originally Posted by TheWrapperGuy View Post
    The following can be added to your Search sheet macros in the IDE
    Please Login or Register  to view this content.
    Thank you...I do want it cleared when a new search starts...does the code above allow for that?

    When I use the code, and clear out the search field, it displays everything from data tab...is there a way if search field is blank, that nothing displays??

  6. #6
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: Retrieve data based on a search word

    Here's another possibility using a different method.
    Right click on the "Search" worksheet tab and choose view code and paste the code into the blank window.

    Please Login or Register  to view this content.
    Click the * Add Reputation button in the lower left hand corner of this post to say thanks.

    Don't forget to mark this thread SOLVED by going to the "Thread Tools" drop down list above your first post and choosing solved.

  7. #7
    Registered User
    Join Date
    04-21-2015
    Location
    Florida, USA
    MS-Off Ver
    2010
    Posts
    20

    Re: Retrieve data based on a search word

    Quote Originally Posted by skywriter View Post
    Here's another possibility using a different method.
    Right click on the "Search" worksheet tab and choose view code and paste the code into the blank window.

    Please Login or Register  to view this content.
    Thank you, but if i clear out the search field, it does not clear out the past search data.

  8. #8
    Registered User
    Join Date
    12-10-2015
    Location
    Winnipeg
    MS-Off Ver
    2013
    Posts
    18

    Re: Retrieve data based on a search word

    Try:
    Please Login or Register  to view this content.

  9. #9
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: Retrieve data based on a search word

    Quote Originally Posted by tnsvolley View Post
    Thank you, but if i clear out the search field, it does not clear out the past search data.
    You sure that's what you want?

    There's never a time when you want to search, keep the data and then search again with perhaps another term?

    I would suggest a clear button using another macro.

  10. #10
    Registered User
    Join Date
    04-21-2015
    Location
    Florida, USA
    MS-Off Ver
    2010
    Posts
    20

    Re: Retrieve data based on a search word

    Quote Originally Posted by TheWrapperGuy View Post
    Try:
    Please Login or Register  to view this content.
    If i type in micro, i get three results. Then I clear the search field by hitting backspace, and it displays everything, looping, says Not Responding and then is blank again.

  11. #11
    Registered User
    Join Date
    04-21-2015
    Location
    Florida, USA
    MS-Off Ver
    2010
    Posts
    20

    Re: Retrieve data based on a search word

    Quote Originally Posted by skywriter View Post
    You sure that's what you want?

    There's never a time when you want to search, keep the data and then search again with perhaps another term?

    I would suggest a clear button using another macro.
    If I type in "micro" and get results, I see three. I would like to clear Search field by using delete or backspace so that when I close it and reopen, tab 1 is empty. As code is now, when I clear by hitting backspace, everything is displayed.

  12. #12
    Registered User
    Join Date
    12-10-2015
    Location
    Winnipeg
    MS-Off Ver
    2013
    Posts
    18

    Re: Retrieve data based on a search word

    Instead of back space, try hitting the Del key and then press enter

  13. #13
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: Retrieve data based on a search word

    With this code you have to type a search term and hit enter.

    If you choose the search box again and hit delete it will clear the old data.

    If you choose the search box again and type another term the previous data will be preserved and some new data will come in below the old data.

    Please Login or Register  to view this content.
    Last edited by skywriter; 12-23-2015 at 05:21 PM.

  14. #14
    Registered User
    Join Date
    04-21-2015
    Location
    Florida, USA
    MS-Off Ver
    2010
    Posts
    20

    Re: Retrieve data based on a search word

    Quote Originally Posted by skywriter View Post
    With this code you have to type a search term and hit enter.

    If you choose the search box again and hit delete it will clear the old data.

    If you choose the search box again and type another term the previous data will be preserved and some new data will come in below the old data.

    Please Login or Register  to view this content.
    Ok, sorry to be a pain...this does work with delete, but is there a way to search micro and then search civil, without having to delete?

  15. #15
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: Retrieve data based on a search word

    Quote Originally Posted by tnsvolley View Post
    Ok, sorry to be a pain...this does work with delete, but is there a way to search micro and then search civil, without having to delete?
    Yes, I explained that in the last paragraph.

    You type micro hit enter, select the search box again and type civil and hit enter again.

    Civil will replace micro by just selecting the box and typing. No need to backspace or hit delete or highlight the previous term, just click the box and start typing and hit enter.
    Last edited by skywriter; 12-23-2015 at 06:00 PM.

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

    Re: Retrieve data based on a search word

    tnsvolley, please do not hit "Reply With Quote" every time you add a post. It is not necessary quote posts unless there is something specific you are responding to. Even then just quote the relevant portion.



    Rule #12. Don't quote whole posts -- it's just clutter. If you are responding to a post out of sequence, limit quoted content to a few relevant lines that makes clear to whom and what you are responding.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  17. #17
    Registered User
    Join Date
    12-10-2015
    Location
    Winnipeg
    MS-Off Ver
    2013
    Posts
    18

    Re: Retrieve data based on a search word

    I'm curious tnsvolley, have you tried my last code block? I've run it multiple ways from my end and I'm pretty sure it meets your requirements. I ask because you haven't said either way.

+ 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] Autocomplete search word based on Initial first/random word
    By radian89 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-19-2015, 11:51 PM
  2. Retrieve data from Google search and/or Wikipedia with VBA
    By cristinik in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 2
    Last Post: 03-12-2014, 08:41 AM
  3. [SOLVED] Search & retrieve data between sheets
    By brisser90 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-17-2012, 03:13 PM
  4. Replies: 2
    Last Post: 01-13-2012, 10:01 AM
  5. Problem with search/retrieve data
    By sdrubezki in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 08-12-2010, 11:21 AM
  6. Use macro to search and retrieve data
    By tfries in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-22-2008, 01:35 PM
  7. retrieve data from Microsoft word
    By hme in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-10-2008, 05:48 AM

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