Delete all Pictures and Objects in a workbook
This tutorial shows how to delete all pictures and objects from an entire workbook at once through the use of VBA
METHOD 1. Delete all Pictures and Objects in a workbook
VBA
Sub Delete_Pictures_Objects()
'declare a variable
Dim ws As Worksheet
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Activate
ws.DrawingObjects.Select
Selection.Delete
ws.DrawingObjects.Select
Selection.Delete
Next
End Sub
ADDITIONAL NOTES
Note 1: This macro will loop through every worksheet in the workbook in which the VBA code is written in and delete all pictures and object.
Note 1: This macro will loop through every worksheet in the workbook in which the VBA code is written in and delete all pictures and object.
EXPLANATION
This tutorial shows how to remove all pictures and objects in a single workbook by using VBA. The macro in this example uses ThisWorkbook to identify in which workbook to delete the pictures and objects, which means that the macro will delete all the pictures and objects in the workbook in which the VBA code is written in.
RELATED TOPICS
Related Topic | Description | Related Topic and Description |
---|---|---|
Delete all Pictures in a sheet | How to delete only pictures in a specific sheet at once | |
Assign a macro to a button | How to assign a macro to a Form Control and ActiveX Control button |