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: 106
Default Selection.Find a formatted date

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...
 
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
Extracting date from Date and Time formatted cell Aviral Sharma Excel Discussion (Misc queries) 2 March 6th 09 05:04 AM
Find cells that are conditionally formatted Code Numpty Excel Discussion (Misc queries) 4 August 11th 08 10:17 AM
How do I find out how a cell is formatted John Excel Discussion (Misc queries) 2 August 5th 08 07:56 PM
find date and copy selection redb Excel Programming 0 January 31st 06 11:31 AM
Find all formatted cells [email protected] Excel Programming 1 December 19th 03 03:45 AM


All times are GMT +1. The time now is 09:26 AM.

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"