bonjour ,
J'ai plusieurs macro du même type qui me ralentis mon fichier Excel. Pouvez vous m'aider pour améliorer ma macro.

Code vba : 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
61
Sub lireEXP_Mem1(Fichier As String)
Application.ScreenUpdating = False
Dim intFileNum%, bytTemp As Byte, intCellRow As Double, A As String, ligne As Integer, ligne_TAB As Integer, Colone_TAB As Integer, Colone_index As Integer    '% = as integer
Dim nf As String, val As String, fichier_base As String, nom As String, val2 As String
fichier_base = ActiveWorkbook.Name
nom = ActiveWorkbook.Name
 
 
    intFileNum = FreeFile
    intCellRow = 1
    nf = Fichier
 
 
    Open nf For Binary Access Read As intFileNum
    Worksheets("Décodage").Range("A:IV").Clear
      Worksheets("Décodage").Columns("A:IV").NumberFormat = "@"
  ligne = 1
  Colone_TAB = 1
  Colone_index = 1
  ligne_TAB = 1
    Do While Not EOF(intFileNum)
        intCellRow = intCellRow + 1
        'ligne = ligne + 1
        Get intFileNum, , bytTemp
        val = Trim(Hex(bytTemp))
        'val2 = Trim(Hex(bytTemp))
 
        If intCellRow > 201 Then
             If intCellRow Mod 2 <> 0 Then
                If Colone_TAB = 1 Then
                Worksheets("Décodage").Cells(ligne, Colone_TAB) = intCellRow - 1
                End If
                Worksheets("Décodage").Cells(ligne, Colone_TAB + 1) = Format(A & (Left("00", 2 - Len(val)) & val), "@")
                ligne = ligne + 1
                Colone_index = Colone_index + 1
                If Colone_index > 219 Then
                   Colone_index = 1
                   Colone_TAB = Colone_TAB + 1
                   ligne = 1
                End If
            End If
        End If
 
 
 
        If intCellRow Mod 2 = 0 Then
        A = Left("00", 2 - Len(val)) & val
 
        End If
If Colone_TAB = 255 Then
Exit Do
End If
    Loop
    Close intFileNum
'Mise en forme des Données
 
 
Worksheets("Bilan").Activate
Worksheets("Utilisation").Activate
 
End Sub