G
Guest
I need to find the first cell in a sorted ascending column of dates (Col A,
formatted as ddd dd/mm/yyyy) that is equal or greater than a user input date
(Formatted as dd/mm/yy or dd/mm/yyyy). I use the following command :
Range("A:A").Select
Selection.Find(What:=Format(user_input, "#"), After:=ActiveCell,
LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByRows,
SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False).Activate
If the field in col A is numeric i.e. 38930 for Aug.1,2006 the command is
successful. If it is formatted as Tue 01/08/2006 it is not successful. Is
there something I have to change in the arguments of .find ? Mind you, I am
not accustomed to object handling code (With .. End With and so on)
Thanks in advance
P.S. The Selection.Find command is successful for exact matches. I haven't
tried yet the "greater than" possibility...
formatted as ddd dd/mm/yyyy) that is equal or greater than a user input date
(Formatted as dd/mm/yy or dd/mm/yyyy). I use the following command :
Range("A:A").Select
Selection.Find(What:=Format(user_input, "#"), After:=ActiveCell,
LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByRows,
SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False).Activate
If the field in col A is numeric i.e. 38930 for Aug.1,2006 the command is
successful. If it is formatted as Tue 01/08/2006 it is not successful. Is
there something I have to change in the arguments of .find ? Mind you, I am
not accustomed to object handling code (With .. End With and so on)
Thanks in advance
P.S. The Selection.Find command is successful for exact matches. I haven't
tried yet the "greater than" possibility...