+ Reply to Thread
Results 1 to 3 of 3

Find exact match.

  1. #1
    Robert.Cordani@us.schneider-electric.com
    Guest

    Find exact match.

    I have a visual basic macro with the following line.
    Set C = .Find(Priority, LookIn:=xlValues)

    The problem is that if priority = 1, I might get back the column that
    has 13 is there any easy way to find an exact match?


  2. #2
    Jim Thomlinson
    Guest

    RE: Find exact match.

    When you do a find it is best to specify all of the settings as the find
    function just uses whatever the last used settings were. So oddly enough your
    code will work sometimes. Here is what you should have...

    Set C = .Find(What:=Priority, _
    LookIn:=xlValues, _
    LookAt:=xlWhole, _
    MatchCase:=True)


    --
    HTH...

    Jim Thomlinson


    "Robert.Cordani@us.schneider-electric.com" wrote:

    > I have a visual basic macro with the following line.
    > Set C = .Find(Priority, LookIn:=xlValues)
    >
    > The problem is that if priority = 1, I might get back the column that
    > has 13 is there any easy way to find an exact match?
    >
    >


  3. #3
    Robert.Cordani@us.schneider-electric.com
    Guest

    Re: Find exact match.

    Perfect, exactly what I needed.
    Thanks.

    Jim Thomlinson wrote:
    > When you do a find it is best to specify all of the settings as the find
    > function just uses whatever the last used settings were. So oddly enough your
    > code will work sometimes. Here is what you should have...
    >
    > Set C = .Find(What:=Priority, _
    > LookIn:=xlValues, _
    > LookAt:=xlWhole, _
    > MatchCase:=True)
    >
    >
    > --
    > HTH...
    >
    > Jim Thomlinson
    >
    >
    > "Robert.Cordani@us.schneider-electric.com" wrote:
    >
    > > I have a visual basic macro with the following line.
    > > Set C = .Find(Priority, LookIn:=xlValues)
    > >
    > > The problem is that if priority = 1, I might get back the column that
    > > has 13 is there any easy way to find an exact match?
    > >
    > >



+ 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