>I am using Vb for Excel and I wanna know how to make a match between dates. Let's say that in a workbook, Range("a1:a300") contains dates. What would be the command to find a match for today's date in that range?
This sample looks for may 28 1998 in the range you specify:
Range("A1:A300").Select
Selection.Find(What:="28/05/98", After:=ActiveCell, LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False).Activate
The easiest way to obtain this code (and this is how I did it for this sample) is to record a macro and look at the code generated.
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com