Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problems with simple query
Message
 
To
06/10/1998 17:09:26
General information
Forum:
Visual Basic
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00144384
Message ID:
00144417
Views:
16
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform