ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,738
- Office Version
- 2007
- Platform
- Windows
Hi,
I wish to delete a photo when the worksheet is closed.
My code that runs when i close the sheet is supplied below.
I have just run the code and noticed that on the sheet DR PDF it has deleted the command button 1 & 2
The code is still on the sheet but the 2 buttons are gone.
HAVING SAID THAT
The sheet EBAY PRINT has the same code & same buttons but these were not touched.
Basically i dont need these command buttons deleted.
On a side note the photos that i did want deleting were actually deleted so that part is fine.
I wish to delete a photo when the worksheet is closed.
My code that runs when i close the sheet is supplied below.
I have just run the code and noticed that on the sheet DR PDF it has deleted the command button 1 & 2
The code is still on the sheet but the 2 buttons are gone.
HAVING SAID THAT
The sheet EBAY PRINT has the same code & same buttons but these were not touched.
Basically i dont need these command buttons deleted.
On a side note the photos that i did want deleting were actually deleted so that part is fine.
Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)Application.ScreenUpdating = False
Sheets("Sheet1").Range("P1:U1").Copy Sheets("Sheet1").Range("E6")
Sheets("Sheet1").Range("P2").Copy Sheets("Sheet1").Range("E7")
Sheets("DR PDF").Range("E6:J6").ClearContents
ActiveSheet.Pictures.Delete
Sheets("EBAY PRINT").Range("E6:J6").ClearContents
ActiveSheet.Pictures.Delete
Sheets("DR PDF").Range("E7").ClearContents
Sheets("EBAY PRINT").Range("E7").ClearContents
Application.ScreenUpdating = True
ActiveWorkbook.Save
End Sub