PDA

View Full Version : Finding (and selecting) the next shape with the same name



RandomGerman
05-26-2015, 12:02 PM
Hi there,

this one is about the same as http://www.vbaexpress.com/forum/showthread.php?52697-Deleting-all-shapes-with-the-same-name-with-one-click

I have built a bundle of macros creating shapes concerning the work status of my presentations, e.g., "To do", "Updated", "Work in progress", and defined a shape name ("Stickerxx") for all of them. I would like to create a macro to jump from one to the next of these shapes, no matter whether the next one is on the same slide of the next or somewhere else. I hoped, it would work in a similar way:

Sub FindNextSticker()
Dim sld As Slide
On Error Resume Next
For Each sld In ActivePresentation.Slides
sld.Shapes("Stickerxx").Select
Next sld
End Sub

But it doesn't. This one works only to select the first one, when I already reached the page. On a second click, nothing happens. Seems to be a bit more difficult than I hoped, although experts may smile about it ...