Use picture and images is very good practice to make excel projects more interactive, Sometimes, there is a need to delete pictures from the workbook. It will be quite tedious task to select each picture and delete it manually.
Such task can be automate using small excel VBA code. Which will delete all pictures from active worksheet.
Here is the code which will delete all pictures from active worksheet:
Sub Delete_Picture()
Application.ScreenUpdating = False
On Error GoTo Err
For Each Pic In ActiveSheet.Pictures
Pic.Delete
Next Pic
Err:
If Err.Number <> 0 Then
MsgBox Err.Description
End If
Application.ScreenUpdating = True
End Sub
Such task can be automate using small excel VBA code. Which will delete all pictures from active worksheet.
Here is the code which will delete all pictures from active worksheet:
Sub Delete_Picture()
'Declare Variables
Dim Pic As ObjectApplication.ScreenUpdating = False
On Error GoTo Err
For Each Pic In ActiveSheet.Pictures
Pic.Delete
Next Pic
Err:
If Err.Number <> 0 Then
MsgBox Err.Description
End If
Application.ScreenUpdating = True
End Sub
No comments:
Post a Comment