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?
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?
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?
>
>
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?
> >
> >
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks