+ Reply to Thread
Results 1 to 3 of 3

Create a Search Box on Userform: if search result found then do this, if not then do that

  1. #1
    Registered User
    Join Date
    09-13-2013
    Location
    Brentwood, TN
    MS-Off Ver
    Excel 2010
    Posts
    2

    Exclamation Create a Search Box on Userform: if search result found then do this, if not then do that

    Hello everyone! I am new to posting on the forum although I have read many post on here before. I was wondering if anyone could assist me with the following:
    I think it should be pretty simple but I am having troubles.

    I have a userform called "frmSearch". There are two items on the form: a text box called "txtURL" and a command button called "cmdSearch".

    Column "B" of my sheet "Benefit_Resources" contains URLs. I would like user to be able to paste a URL into the search box and search... if the URL is found I want it to open another form called "frmFound" and if its not found then open a form called "frmNotFound".

    I have tried the following code but no luck.
    Please Login or Register  to view this content.

    I have attached a workbook with some sample data and this code in it. It keeps returning the NotFound form even if searching for a URL that is there.


    Any help or direction that could be given would be very much appreciated!!

    Thanks in advance!


    ddavis7SearchBoxExample.xlsm
    Last edited by Fotis1991; 09-13-2013 at 10:33 AM. Reason: added code tags

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Create a Search Box on Userform: if search result found then do this, if not then do t

    Welcome to the forum

    Pls

    Use code tags around code.

    Posting code between
    Please Login or Register  to view this content.
    tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here


    I have added code tags to your post. As per forum rule 3, you need to use them whenever you put any code in your post. Please add them in future
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Registered User
    Join Date
    09-13-2013
    Location
    Brentwood, TN
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Create a Search Box on Userform: if search result found then do this, if not then do t

    Thank you, Fortis1991! I will be sure to do this in the future.

+ 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. Macro to search Workbook and create link to found data
    By gosharp in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-07-2012, 06:29 AM
  2. pls hlp: search from 2 worksheets, result displayed on userform
    By hrh in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-26-2012, 08:57 PM
  3. [SOLVED] Macro ignores search code when 1 of the 2 search parameters is not found
    By BrodyNoochie in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-25-2012, 05:21 PM
  4. Create a search box that jumps to items found in list
    By cadmancan in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 10-27-2009, 11:44 AM
  5. worksheetfunction.vlookup result when search argument not found
    By Conor in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-10-2006, 07:16 AM

Tags for this Thread

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