Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problems with simple query
Message
 
À
06/10/1998 17:09:26
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00144384
Message ID:
00144417
Vues:
17
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform