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
| 'modifier pour incrémenter automatiquement de b à f
Ligne1 = 2 'si deja ref existente incrementation b,c,d,e,f
a = Cells(derL1, 8).Text & (Cells(derL1, 7).Text)
Deja = True 'mise à true de la variable déja
Do While Cells(Ligne1, 9).Value <> ""
If Cells(Ligne, 9).Value = Cells(derL1, 8).Text & (Cells(derL1, 7).Text) Then
b = a & "b"
Cells(derL1, 9) = b
Deja = False
Do While Cells(Ligne1, 9).Value <> ""
If Cells(Ligne, 9).Value = Cells(derL1, 8).Text & (Cells(derL1, 7).Text) & "b" Then
c = a & "c"
Cells(derL1, 9) = c
Deja = False
Do While Cells(Ligne1, 9).Value <> ""
If Cells(Ligne, 9).Value = Cells(derL1, 8).Text & (Cells(derL1, 7).Text) & "c" Then
c = a & "c"
Cells(derL1, 9) = c
Deja = False
Exit Do
Do While Cells(Ligne1, 9).Value <> ""
If Cells(Ligne, 9).Value = Cells(derL1, 8).Text & (Cells(derL1, 7).Text) & "d" Then
d = a & "d"
Cells(derL1, 9) = b
Deja = False
Exit Do
Do While Cells(Ligne1, 9).Value <> ""
If Cells(Ligne, 9).Value = Cells(derL1, 8).Text & (Cells(derL1, 7).Text) & "e" Then
e = a & "e"
Cells(derL1, 9) = e
Deja = False
Exit Do
Do While Cells(Ligne1, 9).Value <> ""
If Cells(Ligne, 9).Value = Cells(derL1, 8).Text & (Cells(derL1, 7).Text) & "f" Then
f = a & "f"
Cells(derL1, 9) = f
Deja = False
Exit Do
End If
Ligne1 = Ligne1 + 1
Loop
If Deja = True Then Cells(derL1, 9) = Cells(derL1, 8).Text & (Cells(derL1, 7).Text) & "e"
End If
Ligne1 = Ligne1 + 1
Loop
If Deja = True Then Cells(derL1, 9) = Cells(derL1, 8).Text & (Cells(derL1, 7).Text) & "d"
End If
Ligne1 = Ligne1 + 1
Loop
If Deja = True Then Cells(derL1, 9) = Cells(derL1, 8).Text & (Cells(derL1, 7).Text) & "c"
End If
Ligne1 = Ligne1 + 1
Loop
If Deja = True Then Cells(derL1, 9) = Cells(derL1, 8).Text & (Cells(derL1, 7).Text) & "b"
Exit Do
End If
Ligne1 = Ligne1 + 1
Loop
If Deja = True Then Cells(derL1, 9) = Cells(derL1, 8).Text & (Cells(derL1, 7).Text)
Exit Do
End If
Ligne1 = Ligne1 + 1
Loop
If Deja = True Then Cells(derL1, 9) = Cells(derL1, 8).Text & (Cells(derL1, 7).Text) 'Concaténation du nom du premier auteur suivi de l'année (format00) sans espace |
Partager