+ Reply to Thread
Results 1 to 4 of 4

Find method Returns

  1. #1
    Trent Argante
    Guest

    Find method Returns

    How do i get the Find method to programmically return whether it found the
    specified value or not?
    --
    Trent Argante
    [DC.J(455)]

  2. #2
    Chip Pearson
    Guest

    Re: Find method Returns

    Try something like

    Dim FoundCell As Range
    Set FoundCell = Range(your_range).Find(what:="abc")
    If Not FoundCell Is Nothing Then
    Debug.Print "Found: " & FoundCell.Address
    Else
    Debug.Print "Not Found."
    End If


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com


    "Trent Argante" <TrentArgante@discussions.microsoft.com> wrote in
    message
    news:1E59C444-8F26-4F4B-8C98-8D6F2FB8143C@microsoft.com...
    > How do i get the Find method to programmically return whether
    > it found the
    > specified value or not?
    > --
    > Trent Argante
    > [DC.J(455)]




  3. #3
    Jim Thomlinson
    Guest

    Re: Find method Returns

    For the find you have specified the What. Depending what you are looking for
    (text or number) you should probably specify, LookAt (xlWhole, xlPart),
    LookIn (xlformula, xlValues), MatchCase (true or false). Excel uses the last
    setting that was used for a Find, which may or may not be what you want.

    I have never had any luck determining the setting before doing the find
    (Chip if there is a way I would love to know what it is.) so you may need to
    modify these settings.
    --
    HTH...

    Jim Thomlinson


    "Chip Pearson" wrote:

    > Try something like
    >
    > Dim FoundCell As Range
    > Set FoundCell = Range(your_range).Find(what:="abc")
    > If Not FoundCell Is Nothing Then
    > Debug.Print "Found: " & FoundCell.Address
    > Else
    > Debug.Print "Not Found."
    > End If
    >
    >
    > --
    > Cordially,
    > Chip Pearson
    > Microsoft MVP - Excel
    > Pearson Software Consulting, LLC
    > www.cpearson.com
    >
    >
    > "Trent Argante" <TrentArgante@discussions.microsoft.com> wrote in
    > message
    > news:1E59C444-8F26-4F4B-8C98-8D6F2FB8143C@microsoft.com...
    > > How do i get the Find method to programmically return whether
    > > it found the
    > > specified value or not?
    > > --
    > > Trent Argante
    > > [DC.J(455)]

    >
    >
    >


  4. #4
    Trent Argante
    Guest

    Re: Find method Returns

    Chip & Jim,
    Thank you, both, for your help. The code is running quite well now.
    --
    Trent Argante
    [DC.J(455)]


    "Jim Thomlinson" wrote:

    > For the find you have specified the What. Depending what you are looking for
    > (text or number) you should probably specify, LookAt (xlWhole, xlPart),
    > LookIn (xlformula, xlValues), MatchCase (true or false). Excel uses the last
    > setting that was used for a Find, which may or may not be what you want.
    >
    > I have never had any luck determining the setting before doing the find
    > (Chip if there is a way I would love to know what it is.) so you may need to
    > modify these settings.
    > --
    > HTH...
    >
    > Jim Thomlinson
    >
    >
    > "Chip Pearson" wrote:
    >
    > > Try something like
    > >
    > > Dim FoundCell As Range
    > > Set FoundCell = Range(your_range).Find(what:="abc")
    > > If Not FoundCell Is Nothing Then
    > > Debug.Print "Found: " & FoundCell.Address
    > > Else
    > > Debug.Print "Not Found."
    > > End If
    > >
    > >
    > > --
    > > Cordially,
    > > Chip Pearson
    > > Microsoft MVP - Excel
    > > Pearson Software Consulting, LLC
    > > www.cpearson.com
    > >
    > >
    > > "Trent Argante" <TrentArgante@discussions.microsoft.com> wrote in
    > > message
    > > news:1E59C444-8F26-4F4B-8C98-8D6F2FB8143C@microsoft.com...
    > > > How do i get the Find method to programmically return whether
    > > > it found the
    > > > specified value or not?
    > > > --
    > > > Trent Argante
    > > > [DC.J(455)]

    > >
    > >
    > >


+ 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