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 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
| Sub RECH_UTIL2()
For ligne = 2 To 33
' liste des article analyser
If Cells(ligne, 2) Like "" Then
Cells(ligne, 6).Value = "analyse"
' liste des anciennes classes vehicules
ElseIf Cells(ligne, 4) Like "*" & "_1CN6" & "*" Then
Cells(ligne, 6).Value = "destruction"
ElseIf Cells(ligne, 4) Like "*" & "_1CS8" & "*" Then
Cells(ligne, 6).Value = "destruction"
ElseIf Cells(ligne, 4) Like "*" & "_1CU6" & "*" Then
Cells(ligne, 6).Value = "destruction"
ElseIf Cells(ligne, 4) Like "*" & "_1CV8" & "*" Then
Cells(ligne, 6).Value = "destruction"
ElseIf Cells(ligne, 4) Like "*" & "_1CX1" & "*" Then
Cells(ligne, 6).Value = "destruction"
ElseIf Cells(ligne, 4) Like "*" & "_1PN3" & "*" Then
Cells(ligne, 6).Value = "destruction"
'liste des années et mois à plus de 10 annees en date fin
ElseIf Cells(ligne, 5) Like "*" & "198" & "*" Then
Cells(ligne, 6).Value = "destruction"
ElseIf Cells(ligne, 5) Like "*" & "199" & "*" Then
Cells(ligne, 6).Value = "destruction"
ElseIf Cells(ligne, 5) Like "*" & "2000" & "*" Then
Cells(ligne, 6).Value = "destruction"
ElseIf Cells(ligne, 5) Like "*" & "2001" & "*" Then
Cells(ligne, 6).Value = "destruction"
ElseIf Cells(ligne, 5) Like "*" & "2002" & "*" Then
Cells(ligne, 6).Value = "destruction"
ElseIf Cells(ligne, 5) Like "*" & "2003" & "*" Then
Cells(ligne, 6).Value = "destruction"
ElseIf Cells(ligne, 5) Like "*" & "2004" & "*" Then
Cells(ligne, 6).Value = "destruction"
ElseIf Cells(ligne, 5) Like "*" & "200501" & "*" Then
Cells(ligne, 6).Value = "destruction"
'liste des années et mois à plus de 10 annees en date debut
ElseIf Cells(ligne, 3) Like "*" & "198" & "*" Then
Cells(ligne, 6).Value = "destruction"
ElseIf Cells(ligne, 3) Like "*" & "199" & "*" Then
Cells(ligne, 6).Value = "destruction"
ElseIf Cells(ligne, 3) Like "*" & "2000" & "*" Then
Cells(ligne, 6).Value = "destruction"
ElseIf Cells(ligne, 3) Like "*" & "2001" & "*" Then
Cells(ligne, 6).Value = "destruction"
ElseIf Cells(ligne, 3) Like "*" & "2002" & "*" Then
Cells(ligne, 6).Value = "destruction"
ElseIf Cells(ligne, 3) Like "*" & "2003" & "*" Then
Cells(ligne, 6).Value = "destruction"
ElseIf Cells(ligne, 3) Like "*" & "2004" & "*" Then
Cells(ligne, 6).Value = "destruction"
ElseIf Cells(ligne, 3) Like "*" & "200501" & "*" Then
Cells(ligne, 6).Value = "destruction"
Else
Cells(ligne, 6).Value = "conserver"
End If
Next
Call traitement
End Sub
Sub traitement()
Dim dl As Long
dl = ActiveSheet.Range("a" & Rows.Count).End(xlUp).Row
Dim i As Integer, i2 As Integer
i = 2
i2 = 3
For i = 2 To dl
While ActiveSheet.Range("a" & i) = ActiveSheet.Range("a" & i2)
ActiveSheet.Range("f" & i & ":f" & i2).Select
i2 = i2 + 1
Wend
If Application.WorksheetFunction.CountIf(Selection, "conserver") > 0 Then
Selection = "conserver"
End If
Next
End Sub |
Partager