Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find Method problem in Excel VBA.... | Excel Worksheet Functions | |||
Using variables to make a date and using find method to find that. | Excel Programming | |||
Problem with find method | Excel Programming | |||
range.find method called into a VBA function (problem) | Excel Programming | |||
? Find method | Excel Programming |