+ Reply to Thread
Results 1 to 6 of 6

Find Next is not working for me.......

  1. #1
    Tom
    Guest

    Find Next is not working for me.......

    I am trying to build a userform that allows a user to enter a search
    string and click a button I have named "Find". This works fine. I
    have created a second button on the user form and have titled it "Find
    Next". I want the user to be able to click this button and search for
    a second occurrence of the original string. I have looked at numerous
    examples of the FindNext method and have noticed that they are all in
    the same subroutine. I am trying to have two separate buttons with
    their own subroutines. I am not having any luck making this work.
    Help......


  2. #2
    Jim Thomlinson
    Guest

    RE: Find Next is not working for me.......

    In the grander shceme of things you are not really doing a find next. You are
    just doing a find looking after the instance you have just found. Your find
    next code should just use the find function and specify the cell that you
    have just found as the starting point for your next seach...
    --
    HTH...

    Jim Thomlinson


    "Tom" wrote:

    > I am trying to build a userform that allows a user to enter a search
    > string and click a button I have named "Find". This works fine. I
    > have created a second button on the user form and have titled it "Find
    > Next". I want the user to be able to click this button and search for
    > a second occurrence of the original string. I have looked at numerous
    > examples of the FindNext method and have noticed that they are all in
    > the same subroutine. I am trying to have two separate buttons with
    > their own subroutines. I am not having any luck making this work.
    > Help......
    >
    >


  3. #3
    Jim Thomlinson
    Guest

    RE: Find Next is not working for me.......

    Sorry to be exact you should specify the cell immediately after the one you
    just found as the starting point, not the cell you just found... Assuming
    that you are selecting the cell then it would be
    LookAfter:=activecell.offset(1,0) or something similar depending on whether
    you are looking up or down or by rows or by columns...
    --
    HTH...

    Jim Thomlinson


    "Jim Thomlinson" wrote:

    > In the grander shceme of things you are not really doing a find next. You are
    > just doing a find looking after the instance you have just found. Your find
    > next code should just use the find function and specify the cell that you
    > have just found as the starting point for your next seach...
    > --
    > HTH...
    >
    > Jim Thomlinson
    >
    >
    > "Tom" wrote:
    >
    > > I am trying to build a userform that allows a user to enter a search
    > > string and click a button I have named "Find". This works fine. I
    > > have created a second button on the user form and have titled it "Find
    > > Next". I want the user to be able to click this button and search for
    > > a second occurrence of the original string. I have looked at numerous
    > > examples of the FindNext method and have noticed that they are all in
    > > the same subroutine. I am trying to have two separate buttons with
    > > their own subroutines. I am not having any luck making this work.
    > > Help......
    > >
    > >


  4. #4
    Tom
    Guest

    Re: Find Next is not working for me.......

    That worked great. thx
    Jim Thomlinson wrote:
    > In the grander shceme of things you are not really doing a find next. You are
    > just doing a find looking after the instance you have just found. Your find
    > next code should just use the find function and specify the cell that you
    > have just found as the starting point for your next seach...
    > --
    > HTH...
    >
    > Jim Thomlinson
    >
    >
    > "Tom" wrote:
    >
    > > I am trying to build a userform that allows a user to enter a search
    > > string and click a button I have named "Find". This works fine. I
    > > have created a second button on the user form and have titled it "Find
    > > Next". I want the user to be able to click this button and search for
    > > a second occurrence of the original string. I have looked at numerous
    > > examples of the FindNext method and have noticed that they are all in
    > > the same subroutine. I am trying to have two separate buttons with
    > > their own subroutines. I am not having any luck making this work.
    > > Help......
    > >
    > >



  5. #5
    Tom Ogilvy
    Guest

    Re: Find Next is not working for me.......

    It's called LookAfter, because it looks after the range provided. Therefore
    you don't need the offset. The range provided would be the last cell it
    looks at.

    --
    Regards,
    Tom Ogilvy


    "Jim Thomlinson" <jamest@tcgiRe-Move-This.com> wrote in message
    news:111AED9B-077B-4D86-BAE7-284FF2552BB6@microsoft.com...
    > Sorry to be exact you should specify the cell immediately after the one

    you
    > just found as the starting point, not the cell you just found... Assuming
    > that you are selecting the cell then it would be
    > LookAfter:=activecell.offset(1,0) or something similar depending on

    whether
    > you are looking up or down or by rows or by columns...
    > --
    > HTH...
    >
    > Jim Thomlinson
    >
    >
    > "Jim Thomlinson" wrote:
    >
    > > In the grander shceme of things you are not really doing a find next.

    You are
    > > just doing a find looking after the instance you have just found. Your

    find
    > > next code should just use the find function and specify the cell that

    you
    > > have just found as the starting point for your next seach...
    > > --
    > > HTH...
    > >
    > > Jim Thomlinson
    > >
    > >
    > > "Tom" wrote:
    > >
    > > > I am trying to build a userform that allows a user to enter a search
    > > > string and click a button I have named "Find". This works fine. I
    > > > have created a second button on the user form and have titled it "Find
    > > > Next". I want the user to be able to click this button and search for
    > > > a second occurrence of the original string. I have looked at numerous
    > > > examples of the FindNext method and have noticed that they are all in
    > > > the same subroutine. I am trying to have two separate buttons with
    > > > their own subroutines. I am not having any luck making this work.
    > > > Help......
    > > >
    > > >




  6. #6
    Tom Ogilvy
    Guest

    Re: Find Next is not working for me.......

    It's called LookAfter, because it looks after the range provided. Therefore
    you don't need the offset. The range provided would be the last cell it
    looks at.

    --
    Regards,
    Tom Ogilvy


    "Jim Thomlinson" <jamest@tcgiRe-Move-This.com> wrote in message
    news:111AED9B-077B-4D86-BAE7-284FF2552BB6@microsoft.com...
    > Sorry to be exact you should specify the cell immediately after the one

    you
    > just found as the starting point, not the cell you just found... Assuming
    > that you are selecting the cell then it would be
    > LookAfter:=activecell.offset(1,0) or something similar depending on

    whether
    > you are looking up or down or by rows or by columns...
    > --
    > HTH...
    >
    > Jim Thomlinson
    >
    >
    > "Jim Thomlinson" wrote:
    >
    > > In the grander shceme of things you are not really doing a find next.

    You are
    > > just doing a find looking after the instance you have just found. Your

    find
    > > next code should just use the find function and specify the cell that

    you
    > > have just found as the starting point for your next seach...
    > > --
    > > HTH...
    > >
    > > Jim Thomlinson
    > >
    > >
    > > "Tom" wrote:
    > >
    > > > I am trying to build a userform that allows a user to enter a search
    > > > string and click a button I have named "Find". This works fine. I
    > > > have created a second button on the user form and have titled it "Find
    > > > Next". I want the user to be able to click this button and search for
    > > > a second occurrence of the original string. I have looked at numerous
    > > > examples of the FindNext method and have noticed that they are all in
    > > > the same subroutine. I am trying to have two separate buttons with
    > > > their own subroutines. I am not having any luck making this work.
    > > > Help......
    > > >
    > > >




+ 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