1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| Private Sub Bouton_Rechercher_Click()
Dim thecell As Range, R As Double, l As Double, z As Long
Feuil6.Activate
Application.ScreenUpdating = False
z = Cells.Find("*", , , , , xlPrevious).Row + 2
For Each thecell In Range("A1", Cells(Rows.Count, "A").End(xlUp))
If Not IsEmpty(thecell) Then
With thecell.Offset(1, 2)
.EntireRow.Hidden = Year(CDate(.Value)) <> CInt(TextBox2.Value)
End With
End If
Next
If (TextBox1.Value <> "") Then
For Each thecell In Range("A1", Cells(Rows.Count, "A").End(xlUp))
If IsEmpty(thecell) Then
With thecell.Offset(1, 2)
.EntireRow.Hidden = Month(CDate(.Value)) <> CInt(TextBox1.Value)
End With
End If
Next
End If
Unload UserForm_Rechercher
For l = 1 To Cells(65536, 1).End(xlUp).Row
If Not Rows(l).Hidden Then R = R + 1
Next l
Cells(z, 3) = R - 2
End Sub |
Partager