?
Solved

Macro not working on  Excel 2010 - Delete Pics on Worksheet

Posted on 2012-09-18
1
Medium Priority
?
338 Views
Last Modified: 2012-09-18
I have been using this macro to erase all the "tickmarks"  shapes on the worksheet.  It doesn't weem to be working after the change over to Excel 2010.  What changed?



Sub delpics()

Dim iResult As Integer

iResult = MsgBox("Do You Want to Delete Pictures and Tick Marks on this Worksheet", vbYesNo, "OK to Delete ?     This CANNOT be undone")

If iResult = 7 Then Exit Sub

Dim oShape As Excel.Shape

For Each oShape In ActiveSheet.Shapes

    If oShape.Type = msoPicture Then

        oShape.Delete

    End If

Next

End Sub




thanks, Eric
0
Comment
Question by:ekaplan323
1 Comment
 
LVL 39

Accepted Solution

by:
nutsch earned 2000 total points
ID: 38410447
Do you have any other type of shapes on the sheet that you'd like to keep? Otherwise, just run

Sub delpics()

if MsgBox("Do You Want to Delete Pictures and Tick Marks on this Worksheet", vbYesNo, "OK to Delete ?     This CANNOT be undone")=vbno Then Exit Sub

Dim oShape As Excel.Shape

For Each oShape In ActiveSheet.Shapes
        oShape.Delete
Next

End Sub

Open in new window


Thomas
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa‚Ķ

612 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question