+ Reply to Thread
Results 1 to 15 of 15

Search Box - multiple columns

  1. #1
    Registered User
    Join Date
    06-14-2015
    Location
    Toronto, ON
    MS-Off Ver
    Office 365 (Work); Office 11 (Home)
    Posts
    55

    Search Box - multiple columns

    On the attached spreadsheet, I need to be able to enter info into the search box on the 'search tool' tab and have it pull the information from any of the columns on the main tab. Also need a "No Report Found" if nothing is found.
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,935

    Re: Search Box - multiple columns

    Is this a VBA query?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    06-14-2015
    Location
    Toronto, ON
    MS-Off Ver
    Office 365 (Work); Office 11 (Home)
    Posts
    55

    Re: Search Box - multiple columns

    Not sure, I thought it was a search box program. I'm not sure how a VBA works compared to a search function, if I have posted in the wrong forum then I apologize and I can move it to the VBA forum if needed.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,935

    Re: Search Box - multiple columns

    You have posted a macro-enabled workbook. There is a form with a form cont=rol (text box). This means it's a VBA query.

    I am moving this to the correct section.

  5. #5
    Registered User
    Join Date
    06-14-2015
    Location
    Toronto, ON
    MS-Off Ver
    Office 365 (Work); Office 11 (Home)
    Posts
    55

    Re: Search Box - multiple columns

    Thank you, i will attempt to ensure if there is a macro involved to ensure it is posted correctly.

  6. #6
    Valued Forum Contributor
    Join Date
    02-02-2016
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    1,004

    Re: Search Box - multiple columns

    Quote Originally Posted by Akela928 View Post
    I need to be able to enter info into the search box on the 'search tool' tab and have it pull the information from any of the columns on the main tab.
    Do want to search in all columns simultaneously or select a specific column of your choice to search in?

  7. #7
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,304

    Re: Search Box - multiple columns

    Have a trial of the attached - I have placed your data in a 'structured table' (they are more suited to data handling).
    For satisfactory searches it is best if all fields contain data (even if it is common and a repeat of the cell above/below).
    With 'structured tables' do not extend them with blank rows - to add data just start typing in the row immediately under the table, as you move from the first cell the table will dynamically expand to intergrate the added data.
    after typing in the 'keyword' textbox the 'GO' button will search for a 'string' or 'partial string' and put any found rows in the listbox for a final choice, then transfer to the blank table for viewing.
    Notice the great reduction in file size as a result of removing unnecessary pre-formatting.
    Attached Files Attached Files
    Last edited by torachan; 07-10-2023 at 08:06 AM.
    Torachan,

    Mission statement; Promote the use of Tables, Outlaw the use of 'merged cells' and 'RowSource'.

  8. #8
    Registered User
    Join Date
    06-14-2015
    Location
    Toronto, ON
    MS-Off Ver
    Office 365 (Work); Office 11 (Home)
    Posts
    55

    Re: Search Box - multiple columns

    Sorry for the delay in getting back, I had a family emergency to deal with. But yes simultaneously, for example if I type in safety helmets, then every infraction for this would populate on the search tab.

  9. #9
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,304

    Re: Search Box - multiple columns

    I have uploaded version 2 to post#7 (I noted your post #8 - "safety helmets") so have extended the search range to cover that field.

  10. #10
    Registered User
    Join Date
    06-14-2015
    Location
    Toronto, ON
    MS-Off Ver
    Office 365 (Work); Office 11 (Home)
    Posts
    55

    Re: Search Box - multiple columns

    I am not sure how this works. The search tab looks similar to the main but when I enter data into the first cell (A2) nothing happens. The rest of the line does not populate. Am I missing something here?

  11. #11
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,304

    Re: Search Box - multiple columns

    Big yellow button "Show Search Form" - press it and you have a search form - type in your search keyword - press go - listbox populates with all rows containing keyword - select appropriate row - sheet table then populates.

  12. #12
    Registered User
    Join Date
    06-14-2015
    Location
    Toronto, ON
    MS-Off Ver
    Office 365 (Work); Office 11 (Home)
    Posts
    55

    Re: Search Box - multiple columns

    Sorry but I don't have a big yellow button, attached is the screen shot of what opens from the file download you sent
    Attached Files Attached Files

  13. #13
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,304

    Re: Search Box - multiple columns

    Your screen is obviously smaller than mine - bring column 'J' into view.

    Attachment 835971

  14. #14
    Registered User
    Join Date
    06-14-2015
    Location
    Toronto, ON
    MS-Off Ver
    Office 365 (Work); Office 11 (Home)
    Posts
    55

    Re: Search Box - multiple columns

    Thank you, that works but not what I'm looking forward. I need the document to list the entire compliment of what we search for. Example: if we search for "safety helmets", we need to see all infractions for this and then be able to download them into a spreadsheet for forwarding to individual dept. mgrs., I am not dealing with tech savvy individuals so the simplest method would be to have them populate on a spreadsheet that can then be manipulated and saved.

  15. #15
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,304

    Re: Search Box - multiple columns

    try the attached - is that any better ???
    Attached Files Attached Files

+ 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. Replies: 1
    Last Post: 12-13-2022, 01:01 AM
  2. Replies: 2
    Last Post: 12-23-2020, 02:11 PM
  3. Replies: 5
    Last Post: 12-23-2020, 08:21 AM
  4. [SOLVED] Search multiple columns from Multiple Worksheets and copy rows into a Summary Worksheet
    By kljohn01 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 09-07-2017, 03:46 PM
  5. Replies: 6
    Last Post: 08-22-2014, 08:47 AM
  6. formulas for search based on multiple criteria in multiple columns
    By oneworld in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-02-2013, 06:57 AM
  7. Replies: 7
    Last Post: 03-08-2010, 06:36 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