Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tim Tim is offline
external usenet poster
 
Posts: 408
Default Deleting shapes/objects from a preselected area

Is there a way to delete shapes/objects from a preselected area? I am trying
to use the following macro, but it takes a long time. It also has the
problem as you can't tell which object is selected when the dialog box is
open.
Tim

Sub delete_objects_in_an_area()
Dim shp As Shape
For Each shp In ActiveSheet.Shapes
shp.Select 'can't determine which shape is selected
'ActiveSheet.activeShape.Select
'need to select shape first so I know whether to delete or not
response = MsgBox("Delete shape?", vbYesNoCancel + vbCritical +
vbDefaultButton2)
If response = vbYes Then
shp.Delete
ElseIf response = vbCancel Then
Exit Sub
End If
Next
end sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Deleting shapes/objects from a preselected area

See first posting of this question for a suggestion.

--
Regards,
Tom Ogilvy


"Tim" wrote in message
...
Is there a way to delete shapes/objects from a preselected area? I am

trying
to use the following macro, but it takes a long time. It also has the
problem as you can't tell which object is selected when the dialog box is
open.
Tim

Sub delete_objects_in_an_area()
Dim shp As Shape
For Each shp In ActiveSheet.Shapes
shp.Select 'can't determine which shape is selected
'ActiveSheet.activeShape.Select
'need to select shape first so I know whether to delete or not
response = MsgBox("Delete shape?", vbYesNoCancel + vbCritical +
vbDefaultButton2)
If response = vbYes Then
shp.Delete
ElseIf response = vbCancel Then
Exit Sub
End If
Next
end sub



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Advanced formatting symbols/shapes objects RLang Excel Discussion (Misc queries) 0 May 16th 08 02:25 PM
Deleting shapes in an area Tim Excel Programming 2 October 27th 04 08:51 PM
Trying To Store Shapes/Objects to an array ?? Tom Ogilvy Excel Programming 2 September 21st 04 09:49 PM
Trying To Store Shapes/Objects to an array ?? Dan Thompson Excel Programming 0 September 21st 04 08:37 PM
Selecting drawing objects or shapes in a macro John DeFiore Excel Programming 3 October 13th 03 02:26 PM


All times are GMT +1. The time now is 02:22 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"