![]() |
Trigger macro to run when picture is deleted
I need to find a way to have a macro run when a picture on
a worksheet is deleted. The pictures are loaded into the worksheet using a macro - when the picture is loaded descriptive text in a cell is added to the worksheet that corresponds to the picture. If a picture is loaded accidentally the user has the option of clicking on the picture and hitting the delete key - the problem is the corresponding text remains. How can I get a macro to run each time a picture is deleted that will delete the picture description??? I have searched past threads but can't seem to get something that is similar. David |
Trigger macro to run when picture is deleted
Another option I was considering was to somehow link the
range value with the picture when it is loaded so that if the picture is deleted the range is also deleted but I'm not sure if this is possible. David -----Original Message----- I need to find a way to have a macro run when a picture on a worksheet is deleted. The pictures are loaded into the worksheet using a macro - when the picture is loaded descriptive text in a cell is added to the worksheet that corresponds to the picture. If a picture is loaded accidentally the user has the option of clicking on the picture and hitting the delete key - the problem is the corresponding text remains. How can I get a macro to run each time a picture is deleted that will delete the picture description??? I have searched past threads but can't seem to get something that is similar. David . |
Trigger macro to run when picture is deleted
Hi David,
You could use OnKey to reassign the Delete key to a macro something like this, Sub MyDeleteKey() If TypeName(Selection) = "Picture" Then 'Special Delete Else Selection.Delete End If End Sub Beware this is just air-code, and you'll need to do better than just Selection.Delete. Not all types of selections will have a delete method. Regards, Vic Eldridge "David Cuthill" wrote in message ... I need to find a way to have a macro run when a picture on a worksheet is deleted. The pictures are loaded into the worksheet using a macro - when the picture is loaded descriptive text in a cell is added to the worksheet that corresponds to the picture. If a picture is loaded accidentally the user has the option of clicking on the picture and hitting the delete key - the problem is the corresponding text remains. How can I get a macro to run each time a picture is deleted that will delete the picture description??? I have searched past threads but can't seem to get something that is similar. David |
All times are GMT +1. The time now is 07:46 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com