1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| Private Sub Worksheet_Change(ByVal Target As Range)
Dim i, j, c As Integer
Target.Row = i
c = 1
If Not Intersect(Range("b4:b1000"), Target) Is Nothing Then
If Left(Sheets("PLANNING").Cells(i, 2), 4) = "CAMP" Then
Sheets("PLANNING").Cells(i, 2).Interior.ColorIndex = 46
For j = 4 To 1000
If Sheets("CODE").Cells(j, 3) = Sheets("PLANNING").Cells(i, 4) And Sheets("CODE").Cells(j, 4) = Sheets("PLANNING").Cells(i, 5) And Sheets("CODE").Cells(j, 5) = Sheets("PLANNING").Cells(i, 6) And Left(Sheets("CODE").Cells(j, 7), 2) = Sheets("PLANNING").Cells(i, 7) And Sheets("CODE").Cells(j, 8) = Sheets("PLANNING").Cells(i, 8) Then
Sheets("PLANNING").Cells(i + c, 2) = Sheets("CODE").Cells(j, 1)
c = c + 1
End If
Next
End If
End If
End Sub |
Partager