Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default 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
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
Finding duplicate records that are not exact matches but very clos Carol Excel Discussion (Misc queries) 1 January 9th 09 04:47 PM
FINDING AN EXACT MATCH ON 2 DIFFERENT SHEETS THEN EXECUTING A FORM Morton Detwyler[_2_] Excel Worksheet Functions 3 December 2nd 08 06:58 PM
finding exact matches ft1986 Excel Worksheet Functions 3 July 11th 07 09:32 PM
Finding EXACT matches within separate rows IowaTracy Excel Discussion (Misc queries) 5 August 13th 06 06:55 AM
finding exact matches using vlookup Ekazakoff Excel Worksheet Functions 9 July 29th 06 02:24 PM


All times are GMT +1. The time now is 05:44 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"