Bonjour,
Je sais que le sujet a déjà été traiter 52 miles fois, mais je n'arrive pas à comprendre pourquoi cela ne fonctionne pas.
J'ai fais une macro qui trie entre deux dates mais celle-ci ne fonctionne pas.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
28
29
30
31
Sub Macro2Date()
 Dim Datedebut As String
 Dim Datefin As String
 Dim A As Date
 Dim B As Date
 
 Datedebut = InputBox("Entrer la date de debut au format JJ/MM/AAAA", _
 "Format jour/mois/année")
 If Datedebut = "" Then Exit Sub
 Datefin = InputBox("Entrer la date de fin au format JJ/MM/AAAA", _
 "Format jour/mois/année")
 If Datefin = "" Then Exit Sub
If Datefin > Datedebut Then
    A = Datefin
    B = Datedebut
Else
: A = Datedebut
    B = Datefin
End If
 
If Datedebut = "" Then Exit Sub
If Datefin = "" Then Exit Sub
If IsDate(A) And IsDate(B) Then
 With Sheets("Base de données")
 .Range("$A$1:$BY$8").AutoFilter Field:=31, _
 Criteria1:=">=" & Format(A, "mm/dd/yyyy"), Operator:=xlAnd, _
 Criteria2:="<=" & Format(B, "mm/dd/yyyy")
 
End With
End If
End Sub
Avez vous des indication à me donnez.
Cordialement,
Passepartout007