Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Clear all including objects without deleting sheets
Try code like the following:
Sub AAA() Dim WS As Worksheet Dim OleObj As OLEObject Dim SH As Shape Application.ScreenUpdating = False Application.DisplayAlerts = False For Each WS In ThisWorkbook.Worksheets If WS.Tab.ColorIndex 0 Then For Each OleObj In WS.OLEObjects OleObj.Delete Next OleObj For Each SH In WS.Shapes SH.Delete Next SH End If Next WS End Sub Cordially, Chip Pearson Microsoft Most Valuable Professional, Excel, 1998 - 2010 Pearson Software Consulting, LLC www.cpearson.com On Thu, 15 Apr 2010 10:29:02 -0700, Curt wrote: I would like a macro that uses the "EDIT" - "CLEAR ALL" command for all sheets that do not have colored tabs. I would also like it to remove all charts, objects, images, etc. for all sheets that do not have colored tabs. Currently, I can only remove all objects by manually deleting each object one at a time. Deleting the sheets is not an option because that results in cell refrences for me as I refrence cells in the sheets that I am trying to clear. Any help is greatly appreciated! Curt J |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy Excel Chart (including drawn objects) into Word | Charts and Charting in Excel | |||
Including objects based on a condition | Excel Worksheet Functions | |||
deleting objects using VBA | Excel Programming | |||
Deleting name-objects | Excel Programming | |||
Including control toolbox objects in tab order | Excel Programming |