#1
|
||||
|
||||
Help with Shape Deletion on Selection only
Hello Pros, I need your help again. Been trying to rack my brain and been trying over and over again, to Delete Shapes from a document, BUT only upon Selection. NOT from the whole document. Code:
Sub Graph_TEST_LINES_FORME_Supp_On_Select() ActiveDocument.Select For i = ActiveDocument.Shapes.Count To 1 Step -1 ActiveDocument.Shapes(i).Delete Next i End Sub Thanks for any insights you may provide Cendrinne Last edited by Cendrinne; 12-01-2020 at 10:35 PM. |
#2
|
||||
|
||||
Your ActiveDocument.Select line is selecting everything so any subsequent code would apply to the whole document. Perhaps you are looking for something along the following lines.
Code:
Sub DeleteShapes() Do While Selection.Range.ShapeRange.Count > 0 Selection.Range.ShapeRange(1).Delete Loop End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#3
|
||||
|
||||
OMG, Andew, it Worked.
WOW, I didn't know. Thank you so much. I'm so appreciative |
Tags |
delete shape on selection |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Shape Data - Using Fixed List selection in another cell's formula | natelfo | Visio | 1 | 04-22-2019 01:20 PM |
How to change size / shape of a shape in a stencil | tomgoodell | Visio | 1 | 06-30-2016 04:40 AM |
Draw a selection box over a shape | omberlo | PowerPoint | 1 | 11-25-2012 06:44 AM |
Tip on File Deletion | zyzzyva57 | Office | 0 | 01-30-2010 05:33 AM |
IMAP Deletion | MaxRabbit | Outlook | 6 | 10-20-2008 06:33 PM |