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
| Sub CommandButton1_Click()
Windows("Essai003.xlsm").Activate
Dim k As Integer
Dim j As Integer
Dim i As Integer
Dim l As Integer
Sheets("Feuil1").Range("B1").Copy
Windows("Essai004.xlsm").Activate
Worksheets("Feuil1").Cells(1, i).PasteSpecial Paste:=xlValues
For j = 3 To 16
Windows("Essai003.xlsm").Activate
Sheets("Feuil1").Cells(j, 15).Copy
If Cells(j, 10) = "DS17" Then
l = 2
ElseIf Cells(j, 10) = ("DS30") Then
l = 3
ElseIf Cells(j, 10) = ("DS11") Then
l = 4
ElseIf Cells(j, 10) = ("DR28") Then
l = 5
ElseIf Cells(j, 10) = ("DS40") Then
l = 6
ElseIf Cells(j, 10) = ("DS41") Then
l = 7
ElseIf Cells(j, 10) = ("DS08") Then
l = 8
ElseIf Cells(j, 10) = ("DS12") Then
l = 9
ElseIf Cells(j, 10) = ("DR20") Then
l = 10
ElseIf Cells(j, 10) = ("DR15") Then
l = 11
ElseIf Cells(j, 10) = ("DR16") Then
l = 12
ElseIf Cells(j, 10) = ("DR32") Then
l = 13
ElseIf Cells(j, 10) = ("DR18") Then
l = 14
ElseIf Cells(j, 10) = ("DH27") Then
l = 15
ElseIf Cells(j, 10) = ("DS06") Then
l = 16
ElseIf Cells(j, 10) = "DR19" Then
l = 17
ElseIf Cells(j, 10) = "DS05" Then
l = 18
ElseIf Cells(j, 10) = "DR22" Then
l = 19
ElseIf Cells(j, 10) = "DR03" Then
l = 20
ElseIf Cells(j, 0) = "DS42" Then
l = 21
Else:
j = 16
End If
Windows("Essai004.xlsm").Activate
Worksheets("Feuil1").Cells(k, i).PasteSpecial Paste:=xlValues
Next
Windows("Essai003.xlsm").Activate
Cells(2, 1) = i + 1
End Sub |
Partager