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
| Sub NouveauRDV_Calendrier()
'nécéssite d'activer la référence Microsoft Outlook 10.0 Object Library
Dim myOlApp As Object
Set myOlApp = CreateObject("Outlook.Application")
Dim MyItem As Object
Set MyItem = CreateObject("Outlook.AppointmentItem")
Dim Cell As Range
Dim dLgC As Long, dLgR As Long
For Each Cell In Range("A2:A" & Range("A50").End(xlUp).Row)
If Cell.Offset(0, 7).Value = "Y" And Cell.Offset(0, 8).Value = "Y" Then
Set MyItem = myOlApp.CreateItem(olAppointmentItem)
With MyItem
.MeetingStatus = olNonMeeting
.Subject = "ETALONNAGE " & Cell
.Start = Cell.Offset(0, 6)
.AllDayEvent = True
.Location = "Laboratoire Métrologie ILLKIRCH"
.Save
End With
Set MyItem = Nothing
End If
Next Cell
End Sub |
Partager