Consulting

Results 1 to 3 of 3

Thread: Find Method Question

  1. #1
    VBAX Expert
    Joined
    Feb 2005
    Posts
    929
    Location

    Find Method Question

    The VBA Find method starts searching for "what", after some specified cell in a range. If you do not specifiy the "after" parameter, find assumes it to be the first cell in the range; thus Cells(2) is the first cell examined if you set the after parameter to Cells(1) or let it default. How can I force the find method to start at the first cell and search to the last?

    One approach is to start the search "after" the last cell in the range. That works, but seems like a bandaid.

    Thanks
    "It's not just the due date that's important, it's also the do date" [MWE]

    When your problem has been resolved, mark the thread SOLVED by clicking on the Thread Tools dropdown menu at the top of the thread.

  2. #2
    Site Admin
    Urban Myth
    VBAX Guru
    Joined
    May 2004
    Location
    Oregon, United States
    Posts
    4,940
    Location
    Quote Originally Posted by MWE
    One approach is to start the search "after" the last cell in the range. That works, but seems like a bandaid.
    Yes. And yes.

  3. #3
    VBAX Expert
    Joined
    Feb 2005
    Posts
    929
    Location
    Quote Originally Posted by firefytr
    Yes. And yes.
    Thanks (I guess). I wonder why the Find method does not have exclusive variables "StartAt" and "StartAfter" { or would allow you to use Cells(0) to indicate a starting point of Cells(1) } The bandaid is not hard to implement, but does require you to determine the last cell in the range
    "It's not just the due date that's important, it's also the do date" [MWE]

    When your problem has been resolved, mark the thread SOLVED by clicking on the Thread Tools dropdown menu at the top of the thread.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •