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 Update_PPT_dates(PPTDoc As PowerPoint.Presentation, intSlide As Integer)
' déclaration
Dim car_last_month, car_old_month, Text1 As String
Dim car_year, car_year2, j As Integer
' affecation
car_last_month = StrConv(Format(DateAdd("m", -1, Now()), "mmmm"), vbProperCase)
car_old_month = StrConv(Format(DateAdd("m", -2, Now()), "mmmm"), vbProperCase)
'code
If Month(Now()) - 2 <= 0 Then
car_year = Year(Now()) - 1
Else
car_year = Year(Now())
End If
If Month(Now()) - 1 = 0 Then
car_year2 = Year(Now()) - 1
Else
car_year2 = Year(Now())
End If
For i = intSlide To 2
For j = 1 To PPTDoc.Slides(intSlide).Shapes.Count
If PPTDoc.Slides(intSlide).Shapes(j).TextFrame.TextRange.Text = car_old_month & " " & car_year Then
PPTDoc.Slides(intSlide).Shapes(j).TextFrame.TextRange.Text = car_last_month & " " & car_year2
End If
Next
Next
End Sub |
Partager