Bonjour
J’ai un petit problème pour une macro qui est simple mais qui s’exécute très lentement
Est-ce que j’ai mis trop de boucle « For – next » ?
Merci d’avance pour me guider sur la bonne voie
Option Explicit
Private Sub CommandButton1_Click()
Dim ligne, colone, i, b As Integer
Application.ScreenUpdating = False
Sheets("INDEX").Range("A1:s48").Interior.ColorIndex = 4
Sheets("INDEX").Range("t1:t39").Interior.ColorIndex = 4
For ligne = 1 To 48
For colone = 1 To 20
For b = 0 To 500
If Sheets("INDEX").Cells(ligne, colone).Value = Sheets("IMPORT").Range("a" & b + 1).Value And Sheets("INDEX").Range("y1").Value = Sheets("IMPORT").Range("p" & b + 1).Value Then
Sheets("INDEX").Cells(ligne, colone).Interior.ColorIndex = 6
End If
Next
Next
Next
Application.ScreenUpdating = True
End Sub