Bonjour le forum
En cherchant dans le net j'ai rencontré un code qui me permet d'extraire
toutes les lignes correspondant à un mois donné de la feuille.
le ctitère à saisir dans la boite de dialogue est "*/mm/*"
Déjà je ne comprend pas dans ce code pourquoi le choix du critère se fait ainsi
Je voudrais une saisie plus souple du genre "mm" tout court
Merci par avance
Private Sub CmdValider_Click()
With Worksheets("page1")
Dim Plage As Range, cel As Range
Dim c As String, crit As String
crit = Application.InputBox("Veuillez entrer la période à traiter", "Critère")
If VarType(crit) = vbBoolean Then Exit Sub
For Each cel In Range([D2], [D2].End(xlDown))
If cel.Text Like crit Then
If Plage Is Nothing Then
Set Plage = cel.EntireRow
Else
Set Plage = Union(Plage, cel.EntireRow)
End If
End If
Next cel
If Not Plage Is Nothing Then Plage.Copy Sheets("Page2").Range("E" & Rows.Count).End(xlUp).Offset(1, -4)
End With
End Sub