+ Reply to Thread
Results 1 to 7 of 7

"No more instances found"

  1. #1
    Forum Contributor
    Join Date
    08-04-2005
    Location
    Madrid, Spain
    MS-Off Ver
    2010
    Posts
    241

    "No more instances found"

    In a macro I have this search procedure (bottom up and right to left)

    Please Login or Register  to view this content.
    Silly, but I don't know the proper code saying "if there are no more occurrences, then...". None of those in the HELP section (Not Found, NoMatch, Is Not) seem to apply.

    Thanks for your patience
    ACA

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,552
    2 ways
    1)
    Please Login or Register  to view this content.
    2) use object variable
    Please Login or Register  to view this content.

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Your code appears to be looking for a cell, but no serch string to find. Try this
    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Forum Contributor
    Join Date
    08-04-2005
    Location
    Madrid, Spain
    MS-Off Ver
    2010
    Posts
    241
    Thank so very much to you both, jindon and royUK, for the immediate help.
    aca

  5. #5
    Forum Contributor
    Join Date
    08-04-2005
    Location
    Madrid, Spain
    MS-Off Ver
    2010
    Posts
    241
    Your code, works O.K., but finding one or all occurrences at once, and then stopping, is not what I need;
    sorry I didn’t express myself well.

    First, in each case I enter, through an input box, the chain I'm looking for (which I call ‘c’)
    Please Login or Register  to view this content.
    But then I need for the macro to do just what a general search function does (only upwards) i.e.
    Go up, PAUSE at each occurrence and, if that cell is the one I need, let me exit the search and have the cell copied etc.;
    if it is not, let me click somewhere else and GO ON TO THE NEXT occurrence and pause again. And so on.
    But when there are no more, let me kow also (message box “No more to be found”).

    Thanks for your help, and sorry I first mistakenly posted this as a new thread.
    ACA

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,552
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    08-04-2005
    Location
    Madrid, Spain
    MS-Off Ver
    2010
    Posts
    241
    Thank you, jindon: works great! It's what I needed
    Bless you.
    ACA

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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