Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default 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


" 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default 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


" 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find Exact Match using INDEX, MATCH DoubleUU Excel Worksheet Functions 3 August 15th 08 02:42 PM
Find a not exact match using vlookup Russ B Excel Discussion (Misc queries) 1 July 27th 05 08:49 PM
using vlookup to find exact match Janice Lee via OfficeKB.com Excel Discussion (Misc queries) 3 March 25th 05 02:03 AM
find (exact match) ? mark kubicki Excel Programming 1 December 7th 04 08:10 PM
Find a match that;s not exact Phyllis Excel Worksheet Functions 0 November 8th 04 08:12 PM


All times are GMT +1. The time now is 04:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"