Afficher un message
Vieux 24/12/2005, 12h01   #6 (permalink)
Staple1600
XLDnaute Barbatruc
 
Avatar de Staple1600
 
Date d'inscription: juin 2005
Localisation: RENNES
Version Excel : Excel 2000 (PC)
Messages: 6 069
Par défaut Re:critère calculé pour filtre élaboré

Autrement plus complet
Cette macro de F. SIGONNEAU
'http://frederic.sigonneau.free.fr/code/Calendriers/RechercheDeDates.txt
Sub TrouveDatesDUnMoisDonné()
Dim Mois, CellsTrouvées As Range
Dim i&, PlageDates As Range

Mois = InputBox('Mois des dates à chercher (1 à 12) :')
If Mois = '' Or Mois 12 Then Exit Sub
Set PlageDates = Range('A1:A' & Cells(Rows.Count, 'A').End(xlUp).Row)
i = PlageDates.Row
Do
If Month(PlageDates.Cells(i, 1).Value2) = Mois Then
If CellsTrouvées Is Nothing Then
Set CellsTrouvées = PlageDates.Cells(i, 1)
Else: Set CellsTrouvées = Union(CellsTrouvées, PlageDates.Cells(i, 1))
End If
End If
i = i + 1
Loop While i < PlageDates.Row + PlageDates.Rows.Count

If CellsTrouvees Is Nothing Then
MsgBox 'Aucune date en ' & Format(Mois & '/00', 'mmmm')
Else
CellsTrouvées.EntireRow.Select
End If

End Sub
__________________
Cordialement,
__________________
JM




Staple1600 est déconnecté   Réponse avec citation