Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
JNW JNW is offline
external usenet poster
 
Posts: 480
Default Delete all objects on sheet except...

I know I can use ActiveSheet.DrawingObjects.Delete to delete all drawing
objects on a sheet.

Is there a way to select all drawing objects EXCEPT for charts and text
boxes (or anything else for that matter)?
--
JNW
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Delete all objects on sheet except...

I have use this code befo

for each myshape in shapes

if instr(ucase(myshape.name),"CHART") = 0 then

msgbox(myshape.name)
end if

run code above once to make surre you are happy with the results. Then add

myshape.delete into the code.

"JNW" wrote:

I know I can use ActiveSheet.DrawingObjects.Delete to delete all drawing
objects on a sheet.

Is there a way to select all drawing objects EXCEPT for charts and text
boxes (or anything else for that matter)?
--
JNW

  #3   Report Post  
Posted to microsoft.public.excel.programming
JNW JNW is offline
external usenet poster
 
Posts: 480
Default Delete all objects on sheet except...

Joel

Thanks for the reply. I'm not quite understanding what your code does. And
it is erroring at the for next line.

Thanks.
--
JNW


"Joel" wrote:

I have use this code befo

for each myshape in shapes

if instr(ucase(myshape.name),"CHART") = 0 then

msgbox(myshape.name)
end if

run code above once to make surre you are happy with the results. Then add

myshape.delete into the code.

"JNW" wrote:

I know I can use ActiveSheet.DrawingObjects.Delete to delete all drawing
objects on a sheet.

Is there a way to select all drawing objects EXCEPT for charts and text
boxes (or anything else for that matter)?
--
JNW

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Delete all objects on sheet except...

Sub test()
Dim nType As Long
Dim shp As Shape

For Each shp In ActiveSheet.Shapes
nType = shp.Type
Select Case nType
Case msoChart, msoTextBox
' inlcude "or anything else for that matter" not to delete
Case Else
shp.Delete
End Select
Next
End Sub

Regards,
Peter T


"JNW" wrote in message
...
I know I can use ActiveSheet.DrawingObjects.Delete to delete all drawing
objects on a sheet.

Is there a way to select all drawing objects EXCEPT for charts and text
boxes (or anything else for that matter)?
--
JNW



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Delete all objects on sheet except...

You can use Type

See this page for a few examples
http://www.rondebruin.nl/controlsobjectsworksheet.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"JNW" wrote in message ...
I know I can use ActiveSheet.DrawingObjects.Delete to delete all drawing
objects on a sheet.

Is there a way to select all drawing objects EXCEPT for charts and text
boxes (or anything else for that matter)?
--
JNW



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
Delete 1 row of objects, not all on sheet Excel 2007 Paula Excel Discussion (Misc queries) 11 October 6th 09 05:40 PM
delete objects Debi Excel Discussion (Misc queries) 1 January 16th 07 06:56 PM
Delete Picture Objects The Other Mike Excel Programming 10 February 9th 06 06:12 PM
delete hyperlinks from graphical objects in excel sheet v_gyku[_2_] Excel Programming 7 September 27th 05 06:03 AM
Unable to remove Sheet objects in the Microsoft Excel Objects Adrian[_7_] Excel Programming 1 August 26th 04 10:49 PM


All times are GMT +1. The time now is 09:47 PM.

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

About Us

"It's about Microsoft Excel"