Hi All,
I'm having real problems searching for the month and year part in a range of dates.
In column A I have a range of dates from 01/01/2003 to 01/06/2004 in that format (DD/MM/YYYY). I am trying to find the first occurance of a date that is greater than the 31/12/2003. I've recorded myself doing a find in excel which gives the following code, i.e. look for any date containing the month of January 2004:
Cells.Find(What:="*01/2004", After:=ActiveCell, LookIn:=xlValues, LookAt _
:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
This works fine while I'm recording it, and it goes to the desired cell, but my issue is when I run the code in stepping through I get a run-time error '91' Object variable or With Block variable not set.
What's causing this?
Thanks,
Ian
I'm having real problems searching for the month and year part in a range of dates.
In column A I have a range of dates from 01/01/2003 to 01/06/2004 in that format (DD/MM/YYYY). I am trying to find the first occurance of a date that is greater than the 31/12/2003. I've recorded myself doing a find in excel which gives the following code, i.e. look for any date containing the month of January 2004:
Cells.Find(What:="*01/2004", After:=ActiveCell, LookIn:=xlValues, LookAt _
:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
This works fine while I'm recording it, and it goes to the desired cell, but my issue is when I run the code in stepping through I get a run-time error '91' Object variable or With Block variable not set.
What's causing this?
Thanks,
Ian