![]() |
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? |
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? |
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? |
All times are GMT +1. The time now is 11:34 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com