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
| Sub test()
Dim Ligne As Variant, C As Range, Sh As Worksheet
Dim Lig As String, Equipe As String, Secteur As String
With Sheets("Secteur1")
For Each C In .Range("E10,E12,K10,K12,E16,E18,E27,E29,K27,K29,E33,E35,E44,E46,K44,K46,E50,E52")
If C.Column = 5 And (C.Row = 10 Or C.Row = 27 Or C.Row = 44) Then
Lig = C.Offset(-3, -1)
Equipe = Replace(C.Offset(-6, -2), " ", "")
Secteur = C.Offset(-4, -2)
Set Sh = Sheets(Equipe)
End If
If C.Value <> "CHOISIR" Then
Ligne = Application.Match(C.Value, Sh.[B:B], 0)
col = Application.Match(Lig, Sh.[4:4], 0) + 1
If IsNumeric(Ligne) Then
With Sh
.Cells(Ligne, col).Value = .Cells(Ligne, col).Value + 1
.Cells(Ligne, col + 2).Value = Date
Var = .Cells(Ligne, col + 2).Address
End With
End If
End If
Next C
End With
End Sub |
Partager