+ Reply to Thread
Results 1 to 11 of 11

how do you create a "search" button

  1. #1
    Forum Contributor
    Join Date
    08-10-2009
    Location
    nottingham
    MS-Off Ver
    Excel 2010
    Posts
    110

    how do you create a "search" button

    Hi,

    I have a workSheet that looks up a predefined set of numbers from a separate array, but it does it automatically once the numbers are defined in the cell.

    I would like it to only look up the array once you press a "search" button - i.e define the numbers your looking for, then press "Search" and only then you would get the results?

    Any suggestions that do not involve me having to have a ma

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: how do you create a "search" button

    We'd need to see the code in your sheet - but, you can change the name of the routine along with the Target range and trigger the whole thing with a button
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Forum Contributor
    Join Date
    08-10-2009
    Location
    nottingham
    MS-Off Ver
    Excel 2010
    Posts
    110

    Re: how do you create a "search" button

    I would love to claim it as mine but I've got a lot of help from others here to get this far - I think i understand it:

    {=IF(COUNTBLANK($I$2:$I$4)=3,"",(HYPERLINK(INDEX($P$2:$P$33,SMALL(IF(ISNUMBER(MATCH(1*LEFT($N$2:$N$33,$J$6),$I$6,0)),ROW($P$2:$P$33)-1,""),ROWS($1:1))),INDEX($O$2:$O$33,SMALL(IF(ISNUMBER(MATCH(1*LEFT($N$2:$N$33,$J$6),$I$6,0)),ROW($O$2:$O$33)-1,""),ROWS($1:1))))))}

    it refers to the code in Cell I6 and returns all the matches from a separate list. It's great, but would be perfect if it didn't do it until told to...

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: how do you create a "search" button

    Hi Ing,

    My advice was for a VBA routine. Instead - you could just set your calculation mode to manual and then when you're ready just hit the F9 key

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: how do you create a "search" button

    Instead of having a "search button", I would take a slightly different approach. I would have a cell (say A1) where you can put a value (say X), and then adjust that formula like this...
    {=IF(or(A1="",COUNTBLANK($I$2:$I$4)=3),"",(HYPERLINK(INDEX($P$2:$P$33,SMALL(IF(ISNUMBER(MATCH(1*LEFT($N$2:$N$33,$J$6),$I$6,0)),ROW($P$2:$P$33)-1,""),ROWS($1:1))),INDEX($O$2:$O$33,SMALL(IF(ISNUMBER(MATCH(1*LEFT($N$2:$N$33,$J$6),$I$6,0)),ROW($O$2:$O$33)-1,""),ROWS($1:1))))))}
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  6. #6
    Forum Contributor
    Join Date
    08-10-2009
    Location
    nottingham
    MS-Off Ver
    Excel 2010
    Posts
    110

    Re: how do you create a "search" button

    Quote Originally Posted by xladept View Post
    Hi Ing,

    My advice was for a VBA routine. Instead - you could just set your calculation mode to manual and then when you're ready just hit the F9 key
    I had no idea that was there!

    tried it and it sort of works; don't think it's practical for me though, thanks anyhow...

  7. #7
    Forum Contributor
    Join Date
    08-10-2009
    Location
    nottingham
    MS-Off Ver
    Excel 2010
    Posts
    110

    Re: how do you create a "search" button

    Hi FDibbins,

    I cannot get your code to work - it's only recognised as text?

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: how do you create a "search" button

    I only added the bolded part...
    {=IF(or(A1="",COUNTBLANK($I$2:$I$4)=3),"",(HYPERLINK(INDEX($P$2:$P$33,SMALL(IF(ISNUMBER(MATCH(1*LEFT($N$2:$N$33,$J$6),$I$6,0)),ROW($P$2:$P$33)-1,""),ROWS($1:1))),INDEX($O$2:$O$33,SMALL(IF(ISNUMBER(MATCH(1*LEFT($N$2:$N$33,$J$6),$I$6,0)),ROW($O$2:$O$33)-1,""),ROWS($1:1))))))}
    So if you put anything in A1 and I2:I4 contains anything, the rest of the formula should fire.

    Another way would be...
    {=IF(A1="","",if(COUNTBLANK($I$2:$I$4)=3,"",(HYPERLINK(INDEX($P$2:$P$33,SMALL(IF(ISNUMBER(MATCH(1*LEFT($N$2:$N$33,$J$6),$I$6,0)),ROW($P$2:$P$33)-1,""),ROWS($1:1))),INDEX($O$2:$O$33,SMALL(IF(ISNUMBER(MATCH(1*LEFT($N$2:$N$33,$J$6),$I$6,0)),ROW($O$2:$O$33)-1,""),ROWS($1:1)))))))}

  9. #9
    Forum Contributor
    Join Date
    08-10-2009
    Location
    nottingham
    MS-Off Ver
    Excel 2010
    Posts
    110

    Re: how do you create a "search" button

    that seems to work - must have been me. I think I'm going to create a search button in that added to the cell A1 when pressed then get it cleared with the others when the reset button is pressed. should work... thanks FDibbins

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: how do you create a "search" button

    Happy to help

  11. #11
    Forum Contributor
    Join Date
    08-10-2009
    Location
    nottingham
    MS-Off Ver
    Excel 2010
    Posts
    110

    Re: how do you create a "search" button

    It worked! - just need to figure out now how to get rid of the #NUM return in some of the search result boxes when there's more boxes than results, then I'm done.

    Thanks again.

+ 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: 08-15-2014, 06:00 AM
  2. [SOLVED] Button to search workbook for A1="x", if true, then copy Row4 to Sheet1
    By Trentineer in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-16-2014, 09:14 PM
  3. 7 nested IF statements with a SEARCH added IF(ISNUMBER(SEARCH({"INSUR","AP REFUND"}
    By michaelproctor001 in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 12-10-2013, 02:13 PM
  4. Create a Command Button to "Save As" and "Close" an Excel Workbook
    By thedunna in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-26-2013, 05:38 PM
  5. [SOLVED] create links to check boxes marked "good" fair"and "bad"
    By pjb in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-19-2006, 09:25 PM

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