Bonjour à tous,
J'ai besoin de votre aide concernant l'exécution d'une macro. Voici le code
Ce code fonctionnait très bien jusqu'au jour ou je suis passé de XL-2019 à XL 2021. La première partie du code fonctionne bien, c'est-à-dire appliquer un filtre sur un tableau provenant de données externe. Par contre, la msgbox ne s'affiche plus du tout. Une idée ?
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60 Option Explicit Private Sub Worksheet_SelectionChange(ByVal Target As Range) On Error GoTo fin Dim crit1 As String Dim crit2 As Date Dim cel As Range Dim msg As String 'Dim var1 As String Dim i As Integer Dim dl As Integer Dim message As String crit2 = Sheets("VERSION FRANCK").Range("$T$6").Value If Not Application.Intersect(Target, Range("$T$8:$T$207")) Is Nothing Then Application.Calculation = xlCalculationManual crit1 = ActiveCell.Offset(0, -19).Value Sheets("paljmp explig").Select ActiveSheet.ListObjects("paljmp_explig").Range.AutoFilter Field:=3, _ Criteria1:=crit1 ActiveSheet.ListObjects("paljmp_explig").Range.AutoFilter Field:=13, _ Criteria1:=">=" & Format(crit2, "mm/dd/yyyy") ActiveSheet.ListObjects("paljmp_explig").Range.AutoFilter Field:=5, _ Criteria1:=0 Sheets("VERSION FRANCK").Select With Sheets("paljmp explig") dl = .Range("C" & Rows.Count).End(xlUp).Row For i = 1 To dl If .Range("C" & i) = crit1 And .Range("M" & i) >= crit2 And .Range("E" & i) = 0 Then message = message & vbCrLf & .Range("D" & i) & " " & "colis" & " " & "en départ le :" & " " & .Range("M" & i) & " " & .Range("K" & i) & "/" & .Range("L" & i) & Chr(10) End If Next i MsgBox "message", vbExclamation + vbOKOnly, "Voici la liste des expéditions :" End With fin: End If Application.Calculation = xlCalculationAutomatic Sheets("VERSION FRANCK").Select End Sub
Merci pour votre aide.
Partager