+ Reply to Thread
Results 1 to 2 of 2

Performing a search to find first match & cycling through next matches by pressing button

Hybrid View

  1. #1
    Registered User
    Join Date
    04-12-2013
    Location
    Caracas
    MS-Off Ver
    Excel 2007
    Posts
    8

    Performing a search to find first match & cycling through next matches by pressing button

    Hi, folks.

    As the title says, I'm trying to do a search in a given column, find the first match and then cycle through the next matches (if any) by pressing a button.

    The way I have it set up is with a TextBox. I have managed to do the first search by pressing enter in the TextBox using the [I]Find[/I ]method and have Excel select the cell where the match was found. What I want to do next is link a macro to an image or a button and have Excel find the next match, select the corresponding cell and cycle back to the beggining of the calumn when it reaches the end. I have tried using the same Macro with Application.Caller as a way of knowing what called the macro and the FindNext method, but I just can not get it working.

    Any suggestion on how to get this done? I feel I should be able to figure this out, but I just don't have the time to sit and think it through, so I'm reaching out for help.

    Thanks in advanced

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,926

    Re: Performing a search to find first match & cycling through next matches by pressing but

    The find command has an option to start the search after a certain cell. So "recording" the last found position and using this cell should do the job. When find runs out of range, it will cycle back to the top.

    https://msdn.microsoft.com/en-us/lib.../ff839746.aspx.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

+ 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. [SOLVED] Search text in range, if matches, return match value
    By ShakJames in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-13-2016, 06:12 AM
  2. Search for a value if it matches find closest date
    By pedrojoin in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-14-2013, 08:36 AM
  3. Search two columns for identical matches on button press macro
    By RainbowLettering in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-03-2013, 03:03 PM
  4. Replies: 0
    Last Post: 08-11-2012, 03:25 PM
  5. Performing a search to match corresponding entries
    By lukela85 in forum Excel General
    Replies: 3
    Last Post: 08-27-2011, 06:04 AM
  6. Replies: 2
    Last Post: 03-02-2009, 12:15 AM
  7. Search (match) through columns and find ALL matches
    By qz33 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-11-2008, 08:58 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