1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| Sub copie()
nombrejours2 = Cells(3, 2).Value
j = 2
k = 3
For i = 1 To nombrejours2
If Worksheets("Données").Cells(j, 10).Value = "Férié" Then
Worksheets("Feuil3").Cells(5, k).FormulaR1C1 = CStr(Worksheets("Données").Cells(j, 7).Value) & " " & CStr(Left(Worksheets("Données").Cells(j, 9).Value, 5))
Worksheets("Feuil3").Activate
Worksheets("Feuil3").Range(Cells(6, k), Cells(17, k)).Select
With Selection.Interior
.PatternColorIndex = xlAutomatic
.Color = 65535
End With
Else
Worksheets("Feuil3").Cells(5, k).FormulaR1C1 = CStr(Worksheets("Données").Cells(j, 7).Value) & " " & CStr(Left(Worksheets("Données").Cells(j, 9).Value, 5))
End If
j = j + 1
k = k + 1
Next
End Sub |
Partager