Search Box Via Inputbox that returns findings via msgbox

  • Hey yall,

    I need help programming an inputbox that will search a range and return the findings in a msgbox. Im new to vba so please talk to me like an infant :) . I would like to launch the input box with a button. If match is found then fire a msgbox displaying the row contents of the match. If no match found then msgbox No Match. Sorry if im asking alot, im new so be gentle.

    [SIZE=3]The Only Dumb Question Is A Question Not Asked.[/SIZE]

  • Re: Search Box Via Inputbox that returns findings via msgbox


    See these links to get started. There are many more to be had with just little more search effort.


    Find Method


    Collect User Data/Input via an InputBox


    Search for Text From Input Box

  • Re: Search Box Via Inputbox that returns findings via msgbox


    Thanks for pointing me in the right direction. However the help files are even a tad complicated. All i need is a an Inputbox that you put the key word in, then when it finds the keyword it displays the entire row contents in a msgbox. Please help

    [SIZE=3]The Only Dumb Question Is A Question Not Asked.[/SIZE]

  • Re: Search Box Via Inputbox that returns findings via msgbox


    Do you mean all the cells in the corresponding row? How many cells are you looking at?


  • Re: Search Box Via Inputbox that returns findings via msgbox


    Hey SMC, yes i would like to return all the cells in the corresponding row. I have a worksheet with 7 columbs and 1500 rows. My goal is to search for " invoice #" or " PO # " and have the msgbox display these with the other 6 factors of the matching row.

    [SIZE=3]The Only Dumb Question Is A Question Not Asked.[/SIZE]

  • Re: Search Box Via Inputbox that returns findings via msgbox


    SMC this code works great!! But its limited to one search term. i.e column A only. Can it be adapted for 2 or 3 search tearms with the same result?

    [SIZE=3]The Only Dumb Question Is A Question Not Asked.[/SIZE]

  • Re: Search Box Via Inputbox that returns findings via msgbox


    If you want to search on more columns, like A to C, use Columns("A:C").


    If you want to search for multiple texts from the same input box, confirm that, code can be revised.


    If this is not what you meant, please clarify.

  • Re: Search Box Via Inputbox that returns findings via msgbox


    I got it sorted with your code SMC. I used four instances of your code and defined each for specific searches i.e...A:A -1 to 7 would search for and return all cells including what i searched for. I did this for the four search criteria i needed. Thanks a million SMC you truley are a master of your craft. God Bless.:music:

    [SIZE=3]The Only Dumb Question Is A Question Not Asked.[/SIZE]

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!