Sub Test()
Dim dLig As Long
Dim MoisDeb As Integer, MoisFin As Integer, jFin As Integer
Dim NomPro As String, Annee As Integer, sTrim As String
NomPro = "Gates"
' Récupérer l'année indiquée par l'utilisateur
Annee = Sheets("Boutons").Range("B16").Value
' Récupérer le trimestre indiqué par l'utilisateur
sTrim = Sheets("Boutons").Range("B17").Value
' Selon le trimestre choisi, définir les variables
Select Case sTrim
Case "Q1": MoisDeb = 1: MoisFin = 3: jFin = 31
Case "Q2": MoisDeb = 4: MoisFin = 6: jFin = 30
Case "Q3": MoisDeb = 7: MoisFin = 9: jFin = 30
Case "Q4": MoisDeb = 10: MoisFin = 12: jFin = 31
End Select
Worksheets.Add After:=ActiveSheet
ActiveSheet.Name = "Regroupement_" & sTrim
With Sheets("Bill")
dLig = .Range("A" & Rows.Count).End(xlUp).Row
.Range("$A$1:$L$" & dLig).AutoFilter Field:=3, Criteria1:= _
">=" & MoisDeb & "/01" & "/" & Annee, Operator:=xlAnd, Criteria2:="<=" & MoisFin & "/" & jFin & "/" & Annee
.Range("A1").CurrentRegion.Copy
End With
Sheets("Regroupement_" & sTrim).Range("A1").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
End Sub