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
| Public Sub Fraisage(i As Long, j As Long)
Sheets("Planning").Activate
If Sheets("Planning").Cells(2, 2 + j).Value = "" Then
With Sheets("MECA")
.Range("B" & i).Copy
Sheets("Planning").Cells(2, 2 + j).PasteSpecial
.Range("D" & i).Copy
Sheets("Planning").Cells(2, 3 + j).PasteSpecial
.Range("G" & i).Copy
Sheets("Planning").Cells(2, 4 + j).PasteSpecial
End With
ElseIf Sheets("Planning").Cells(3, 2 + j).Value = "" Then
With Sheets("MECA")
.Range("B" & i).Copy
Sheets("Planning").Cells(3, 2 + j).PasteSpecial
.Range("D" & i).Copy
Sheets("Planning").Cells(3, 3 + j).PasteSpecial
.Range("G" & i).Copy
Sheets("Planning").Cells(3, 4 + j).PasteSpecial
End With
ElseIf Sheets("Planning").Cells(4, 2 + j).Value = "" Then
With Sheets("MECA")
.Range("B" & i).Copy
Sheets("Planning").Cells(4, 2 + j).PasteSpecial
.Range("D" & i).Copy
Sheets("Planning").Cells(4, 3 + j).PasteSpecial
.Range("G" & i).Copy
Sheets("Planning").Cells(4, 4 + j).PasteSpecial
End With
ElseIf Sheets("Planning").Cells(5, 2 + j).Value = "" Then
With Sheets("MECA")
.Range("B" & i).Copy
Sheets("Planning").Cells(5, 2 + j).PasteSpecial
.Range("D" & i).Copy
Sheets("Planning").Cells(5, 3 + j).PasteSpecial
.Range("G" & i).Copy
Sheets("Planning").Cells(5, 4 + j).PasteSpecial
End With
ElseIf Sheets("Planning").Cells(5, 2 + j).Value <> "" Then
j = j + 3
End If
End Sub |
Partager