I was searching a way in which I could delete all the content that I have in an excel sheet, so I came across this VBA code:
Sub ClearSheet()
Sheets("Sheet1").Cells.Clear
End Sub
However, I realized that this code was not going to work for me since in the excel sheets I also have objects that are not inside the cells, such as images and objects. Is there a way where I can do a type of reset on the excel sheet and clean it completely?
you could try this if you ONLY have charts and images, but if you have other objects e.g embedded files etc you need to add more for loops to cover each type of object
Dim chtObj As ChartObject
For Each chtObj In ActiveSheet.ChartObjects
chtObj.Delete
Next
Dim Pic As Object
For Each Pic In ActiveSheet.Pictures
Pic.Delete
Next Pic