LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problems with Find and Date Fields in Excel macro

Using Edit | Find interactively to look for a date in a
cell works fine, just like looking for a text string. If
I record it as a macro, however, I get the expected macro:

Cells.Find(What:="31/12/2002", After:=ActiveCell,_
LookIn:=xlFormulas, _
LookAt:=xlWhole, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False, _
SearchFormat:=False).Activate

but this fails with runtime error 91 when I try to re-run
it (ie, it failed to find anything).

Finding text works fine in a macro and amending the
above "date" macro to use:

What:=DateSerial(2003, 12, 31), rather than "31/12/2002"
also works so it seems like some sort of formatting bug
related to the fact that it's a date.

HOWEVER, I only got the idea to try this from the MS
Press book "Excel 2002 VBA Step By Step" and that book
seems to think it works. Any thoughts anyone? Could it
be something to do with a mismatch between US and UK date
formats?

Nick
 
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
F9 problems when updating fields... Luke Williams Excel Discussion (Misc queries) 1 December 12th 07 04:26 PM
EXCEL: Truncating Text Fields to allow Vlookup searches to find da burkeam1113 Excel Worksheet Functions 1 August 21st 07 03:02 AM
Find top date for unique fields jhicsupt Excel Discussion (Misc queries) 1 April 14th 07 10:36 AM
Excel SHOULD NOT AUTO-CHANGE formated text fields to DATE FIELDS! PSSSD Excel Worksheet Functions 2 August 8th 06 09:31 PM
Problems with Find in VBA/Excel Roy Kirkland Excel Worksheet Functions 0 November 22nd 04 02:58 AM


All times are GMT +1. The time now is 09:35 PM.

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

About Us

"It's about Microsoft Excel"