Skip to content

Instantly share code, notes, and snippets.

@MauricioMoraes
Created March 30, 2016 13:24
Show Gist options
  • Save MauricioMoraes/ac8bab724204b6bffeebbd9856b4f5ce to your computer and use it in GitHub Desktop.
Save MauricioMoraes/ac8bab724204b6bffeebbd9856b4f5ce to your computer and use it in GitHub Desktop.
Deletes all pictures and shapes from excel spreadsheet (does it for all sheets inside the document)
Option Explicit
Sub delete_all_shapes()
Dim shape As Shape
Dim worksheet As Worksheet
Dim response As Integer
response = MsgBox("This action will delete all pictures and shapes from your spreadsheet. Do you want to continue?", vbYesNo, "Delete all shapes from spreadsheet")
If response = vbYes Then
For Each worksheet In ThisWorkbook.Worksheets
For Each shape In worksheet.Shapes
shape.Delete
Next shape
Next worksheet
End If
End Sub
@MauricioMoraes
Copy link
Author

Script que apaga todas as imagens e formas em todas as abas de uma planilha do excel.
Obs: Testado para o Excel 2016.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment