• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 341
  • Last Modified:

Macro not working on Excel 2010 - Delete Pics on Worksheet

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
ekaplan323
Asked:
ekaplan323
1 Solution
 
nutschCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now