Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find Exact Match using INDEX, MATCH | Excel Worksheet Functions | |||
Find a not exact match using vlookup | Excel Discussion (Misc queries) | |||
using vlookup to find exact match | Excel Discussion (Misc queries) | |||
find (exact match) ? | Excel Programming | |||
Find a match that;s not exact | Excel Worksheet Functions |