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
|