Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-10-2021, 11:01 AM
bugifa bugifa is offline Delete all objects in a certain zone of the slide Windows 10 Delete all objects in a certain zone of the slide Office 2019
Novice
Delete all objects in a certain zone of the slide
 
Join Date: Dec 2021
Posts: 2
bugifa is on a distinguished road
Default Delete all objects in a certain zone of the slide

I have a problem in editing a long presentation (over 200 slides)



I should make room in the slide, and I would like to delete everything (textboxes, pictures, shapes etc) in a certain area of the slide where I know there are not update data (e.g. top left, bottom, etc)

Is there a way to make it through VBA?

Thanx!
Reply With Quote
  #2  
Old 12-11-2021, 01:18 AM
JohnWilson JohnWilson is offline Delete all objects in a certain zone of the slide Windows 10 Delete all objects in a certain zone of the slide Office 2019
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,912
JohnWilson has a spectacular aura aboutJohnWilson has a spectacular aura about
Default

You can do this but you will need to specify what area you mean

MAKE SURE YOU EXPERIMENT ON A COPY

eg to delete anything that is in the top left 1 inch

NOTE 1 inch is 72 points

Code:
Sub killtop()
Dim L As Long
Dim osld As Slide
For Each osld In ActivePresentation.Slides
For L = osld.Shapes.Count To 1 Step -1
With osld.Shapes(L)
If .Left < 72 And .Top < 72 Then .Delete
End With
Next L
Next osld
End Sub
__________________
Microsoft PowerPoint MVP 2007-2023
Free Advanced PowerPoint Tips and Tutorials
Reply With Quote
  #3  
Old 12-11-2021, 02:06 PM
bugifa bugifa is offline Delete all objects in a certain zone of the slide Windows 10 Delete all objects in a certain zone of the slide Office 2019
Novice
Delete all objects in a certain zone of the slide
 
Join Date: Dec 2021
Posts: 2
bugifa is on a distinguished road
Default

Quote:
Originally Posted by JohnWilson View Post
You can do this but you will need to specify what area you mean

MAKE SURE YOU EXPERIMENT ON A COPY

eg to delete anything that is in the top left 1 inch

NOTE 1 inch is 72 points

Code:
Sub killtop()
Dim L As Long
Dim osld As Slide
For Each osld In ActivePresentation.Slides
For L = osld.Shapes.Count To 1 Step -1
With osld.Shapes(L)
If .Left < 72 And .Top < 72 Then .Delete
End With
Next L
Next osld
End Sub
tnx, tomorrow I'll try and let you know!
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete all objects in a certain zone of the slide How to show hidden objects/images on slide show JustSayHi PowerPoint 3 07-16-2016 12:00 AM
Delete layout slide IvyGrad PowerPoint 2 04-21-2015 05:07 AM
Delete all objects in a certain zone of the slide Delete a slide from a presentation in PPT phamh PowerPoint 5 11-03-2014 01:25 PM
Animating objects on one slide independent of others Fed PowerPoint 1 08-16-2013 08:42 AM
Pivot Table:delete zero values when using calculated objects Serge 007 Excel 1 06-05-2013 11:47 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:32 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft