+ Reply to Thread
Results 1 to 8 of 8

Macro for Search

  1. #1
    Registered User
    Join Date
    10-20-2010
    Location
    Grand Blanc, MI
    MS-Off Ver
    Excel 2003
    Posts
    4

    Macro for Search

    Hello,

    I am in need of a macro and user panel to search my excel database and display the entire row of data. I need to be able to find a range of data from whatever column is selected. Please help. I am not familiar with macros. Thanks.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro for Search

    ...and we're not familiar with your workbook, your search needs, the layout of the data nor the desired layout of the results of a "search" as you imagine it.

    Mockup a sheet in you workbook to demonstrate what the final output should look like based on a sample search. Make sure your workbook includes a sheet with enough sample data to demonstrate where the "results" were culled from.

    Click GO ADVANCED and use the paperclip icon to post up a desensitized copy of your workbook and we'll take a look.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    10-20-2010
    Location
    Grand Blanc, MI
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Macro for Search

    Thanks for responding. I included a diluted part of the database. Let me know if you need more information.
    Attached Files Attached Files

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro for Search

    See, this is simpler than you described. Excel has an AutoFilter feature specifically designed to do what you want.

    1) Click on row 1
    2) Select Data > Filter > AutoFilter
    3) Select the drop down in column R and do a custom filter for:

    Greater than or equal to 400
    ...and...
    Less than or equal to 600

  5. #5
    Registered User
    Join Date
    10-20-2010
    Location
    Grand Blanc, MI
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Macro for Search

    That is what I would like to do, but I need to have a user friendly control for this. Is there a way to make a control panel that would do the same thing but without having to set up a custom filter every time?

    And I do appreciate your help!!!!!

  6. #6
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,352

    Re: Macro for Search

    Hi mpfoust,
    Autofilters are an extension of Advanced Filter. The user interface is a little different and with a little bit of code can extract the filtered data to another range. Perhaps Advanced Filters (instead of Auto Filter) is what you desire.
    http://www.contextures.com/xladvfilter01.html
    http://www.excelfunctions.net/ExcelAdvancedFilter.html

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro for Search

    I added a couple of buttons at the top of your database sheet so you can simply enter your values and the data will be filtered by the column chosen and the values entered.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    10-20-2010
    Location
    Grand Blanc, MI
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Macro for Search

    This is perfect! Thanks for your help!

+ 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