Hello
I'm not sure if my question belongs to this board or someplace else, but let me try it.
I am trying to replace "CW" text in a Text Box in the PowerPoint slide with "CW41" where 41 represents the current week number (WEEKNUM). I will do this on a weekly basis, so the #41 will keep advancing to subsequent #s.
Here is the code I have in the PowerPoint slide (opened from XLS using VBA). Unfortunately, my attempt to automate the numbering process is not working.
Any help would be greatly appreciated
John
I'm not sure if my question belongs to this board or someplace else, but let me try it.
I am trying to replace "CW" text in a Text Box in the PowerPoint slide with "CW41" where 41 represents the current week number (WEEKNUM). I will do this on a weekly basis, so the #41 will keep advancing to subsequent #s.
Here is the code I have in the PowerPoint slide (opened from XLS using VBA). Unfortunately, my attempt to automate the numbering process is not working.
Any help would be greatly appreciated
John
VBA Code:
Sub Find_Replace()
'
Dim sld As Slide
Set sld = ActivePresentation.Slides(1)
Dim shp As Shape
For Each shp In sld.Shapes
If shp.HasTextFrame Then
shp.TextFrame.TextRange.Text = Replace(shp.TextFrame.TextRange.Text, "CW", "CW" & WeekNum(today()))
shp.TextFrame.TextRange.Characters(32, 39).Font.Bold = msoFalse
'
End If
Next shp
End Sub