#1
|
|||
|
|||
Macro To Delete Instance across multiple slides.
Hello, As I progress through my project I find that I may need to delete a particular autoshape on a certain number of slides. Basically I have a call out autoshape with a message in it in about 30 slides 21-51 I want a macro to select the shape (has the same name each time) and delete it. I can record this for 1 slide but Im not sure how to make the macro repeat it for every slide and then stop when it cannot find that shape on a slide or even better if I could use an input box to say which slides I want it to perform the macro on. Thanks |
#2
|
|||
|
|||
The first macro will delete any instance of the name found the second only on selected slides.
Code:
Sub delete_all() Dim shpname As String Dim osld As Slide Dim i As Integer shpname = "the name" On Error Resume Next For Each osld In ActivePresentation.Slides osld.Shapes(shpname).Delete Next osld End Sub Sub deleteFrom_Sel() Dim shpname As String Dim osld As Slide Dim i As Integer shpname = "the name" On Error Resume Next For Each osld In ActiveWindow.Selection.SlideRange osld.Shapes(shpname).Delete Next osld End Sub |
#3
|
|||
|
|||
Very cool John,
Here it is Sub deleteFrom_Sel() Dim shpname As String Dim osld As Slide Dim i As Integer shpname = InputBox("Paste Shape Name Here") On Error Resume Next For Each osld In ActiveWindow.Selection.SlideRange osld.Shapes(shpname).Delete Next osld End Sub So since this worked so nicely how could I go about repeating a recorded macro for every slide. The macro to be recorded would be macro1 or macro4 etc. and this would be asked for by an input box. The problem is though when using application.run it has the file name and then macro name so Im not sure how hard it would be to be able to run this code then it prompt an input box for what macro number you want to run and then this macro would run on all selected slides. This would be way awesome if you needed to add a shape on each slide and send it backward 20 times for 20 slides. Thanks |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Animation across multiple slides - please help | jpscience | PowerPoint | 3 | 12-13-2011 11:32 AM |
Multiple Monitors/One Presentation/Different Slides | future | PowerPoint | 0 | 12-12-2011 02:20 PM |
Music in Powerpoint (multiple slides) | Karelia Suite | PowerPoint | 1 | 11-05-2011 08:34 AM |
How to create multiple pages, 1 instance of word window | cs_starter | Mail Merge | 1 | 09-08-2011 12:52 AM |
Resize video across multiple slides | joelas | PowerPoint | 3 | 09-28-2010 07:59 PM |