Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Finding exact date
I am using the following line of code to find a date formatted cell in range
b3:ab300 that matches the content of the date formatted cell in H8 in the worksheet "Import Macros". The problem that the date 1/1/08 is coming up as a match to the cell containing 11/1/08 and 2/1/08 shows as matching 12/1/08. How can I change it to an exact date match? Thanks much. Set FoundCell = .Range("b3:ab300").Find(what:=Worksheets("Import Macros").Range("h8").Value) |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Finding exact date
Hi,
When using Range.Find, some of the parameters of the Find method, if not explicitely used, keep their values from the previous use of FInd (even from the user doing EditFind). See online doc: "The settings for LookIn, LookAt, SearchOrder, and MatchByte are saved each time you use this method. If you dont specify values for these arguments the next time you call the method, the saved values are used" In your case, it seems like the Find is looking at the part of the cell while you want it to match the whole cell. That is, try using the parameter/value: LookAt:=xlWhole (also check the other parameters eg: Lookin,...) -- Regards, Sébastien <http://www.ondemandanalysis.com <http://www.ready-reports.com "Alex" wrote: I am using the following line of code to find a date formatted cell in range b3:ab300 that matches the content of the date formatted cell in H8 in the worksheet "Import Macros". The problem that the date 1/1/08 is coming up as a match to the cell containing 11/1/08 and 2/1/08 shows as matching 12/1/08. How can I change it to an exact date match? Thanks much. Set FoundCell = .Range("b3:ab300").Find(what:=Worksheets("Import Macros").Range("h8").Value) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Finding duplicate records that are not exact matches but very clos | Excel Discussion (Misc queries) | |||
FINDING AN EXACT MATCH ON 2 DIFFERENT SHEETS THEN EXECUTING A FORM | Excel Worksheet Functions | |||
finding exact matches | Excel Worksheet Functions | |||
Finding EXACT matches within separate rows | Excel Discussion (Misc queries) | |||
finding exact matches using vlookup | Excel Worksheet Functions |