Created
March 30, 2016 13:24
-
-
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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Script que apaga todas as imagens e formas em todas as abas de uma planilha do excel.
Obs: Testado para o Excel 2016.