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 moisSuiv()
Dim list As Variant, c%, drn3%, i%, j%, k%, ws1 As Worksheet, ws2 As Worksheet, ws3 As Worksheet
Application.ScreenUpdating = False
Set ws3 = Sheets("RDV")
Set ws2 = Sheets("listes")
Set ws1 = Sheets("Planning")
drn3 = ws3.Range("A2").End(xlDown).Row
'Indiquer les noms des RDV
c = 0
For j = 2 To 8
For i = 5 To 15 Step 2
For k = 2 To drn3
If ws3.Range("C" & k).Value = ws1.Cells(i, j).Value Then
list(c) = Mid(ws3.Range("B" & k).Value, 1, 10)
MsgBox list(c)
c = c + 1
End If
Next k
list = Array(list(0), list(1), list(2))
ws1.Cells(i + 1, j).Value = list
Next i
Next j
Application.ScreenUpdating = True
End Sub |
Partager