Re
Cela semble super... Toutefois, la macro ne passe pas à l'enregistrement !
Désolé mais je ne vois pas ce qui bloque. Peux tu me dire ce qui ne fonctionne pas exactement ? (chez moi, je ne rencontre pas de problème)
As-tu bien activé les macros en ouvrant le fichier?
CI-joint le fichier modifié pour plusieurs lignes. Ici, on va de la ligne 24 à 42.
Le code se fait fait dès la modification d'une cellule: (on doit pouvoir faire plus court, mais je ne sais pas faire autrement.)
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Range("B24:I42")) Is Nothing Then
Application.ScreenUpdating = False
Range("J24:J42").ClearContents
For k = 24 To 42
Dim lg As Long 'ligne
i = Range("F" & k).Value
Select Case i
Case Is < 50000
lg = 11
Case Is < 70000
lg = 12
Case Is < 90000
lg = 13
Case Is < 100000
lg = 14
Case Is < 110000
lg = 15
Case Is < 120000
lg = 16
Case Is < 130000
lg = 17
Case Is >= 130000
lg = 18
End Select
Dim col As Integer 'colonne
j = Range("D" & k).Value
Select Case j
Case Is < 0.8
col = 2
Case Is < 0.9
col = 3
Case Is < 1
col = 4
Case Is < 1.1
col = 5
Case Is < 1.2
col = 6
Case Is < 1.3
col = 7
Case Is >= 1.3
col = 8
End Select
Cells(lg, col).Copy Range("J" & k)
Next k
End If
End Sub
Edit: Bonsoir Banzai. Bien vu la matrice. Je me disais bien qu'on pouvait le faire par formule mais n'avais pas trouvé. Ca va plus vite.