Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Problem with the FIND method looking for dates.

Help!

I'm sure someone has had this problem before.
Column C is a column of dates, and is formatted as "14-Mar-98".
Some of the cells in column C contain, in integer form, 0 : and are
therefore returning "00/01/1900" in the above format. Therefore why
does the below throw an error! The below code was the result of using
the macro recorder.

Columns("C:C").Select
Selection.Find(What:="00/01/1900", After:=ActiveCell, _
LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False).Activate

Any help greatly appreciated
Jason

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Problem with the FIND method looking for dates.

Hi Jase,

If you have zero values which are formatted to appear as:

"00/01/1900"

Try changing:

LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows,


to;

LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByRows, _

BTW, with your indicated format, I would expect a zero value to appear as:
00-Jan-00

---
Regards,
Norman


"jase" wrote in message
oups.com...
Help!

I'm sure someone has had this problem before.
Column C is a column of dates, and is formatted as "14-Mar-98".
Some of the cells in column C contain, in integer form, 0 : and are
therefore returning "00/01/1900" in the above format. Therefore why
does the below throw an error! The below code was the result of using
the macro recorder.

Columns("C:C").Select
Selection.Find(What:="00/01/1900", After:=ActiveCell, _
LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False).Activate

Any help greatly appreciated
Jason



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Problem with the FIND method looking for dates.

nice one Norman: I'll give that a go.

quite right about the last comment: it appeared as "00/01/1900" in the
formula bar and "00-Jan-00" in the cell. I assume I should use
"00-Jan-00" in my code?

Jason

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
Find Method problem in Excel VBA.... Irmann Excel Worksheet Functions 7 March 10th 08 03:49 AM
Using variables to make a date and using find method to find that. KyWilde Excel Programming 2 April 21st 05 09:43 PM
Problem with find method Ralph Heidecke[_2_] Excel Programming 3 April 18th 05 08:07 PM
range.find method called into a VBA function (problem) Eros Pedrini Excel Programming 5 November 17th 04 12:34 PM
? Find method David Excel Programming 0 October 26th 04 03:39 PM


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