Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete earlier 'Picture' version when new picture copied in
I have a sheet tab that contains data + one Picture object. I have a macro
that allows users to copy/paste this data onto a master sheet tab that may be blank (if it is the first copy), or it may contain previously copied data. Over time, the user will likely use this copy/paste process many times. The issue is that with each copy/paste, the newest version of both the data & picture are copied over the previous. This is no problem for the data as it just overwrites the previous, however, the picture 'pastes' over the top of the old one, leaving each previous version underneath. For example, the first copy will be labeled as 'Picture 1', the next copy will become 'Picture 2', then 'Picture 3', etc. Over time, the file will become huge as each picture object gets stacked on top of the other. What code can I write that will help recognize & delete a previous version of the picture if it exists? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete earlier 'Picture' version when new picture copied in
Sub xxx() Dim shp As Shape For Each shp In ActiveSheet.Shapes If InStr(1, shp.Name, "Picture", vbTextCompare) 0 Then shp.Delete End If Next 'shp End Sub -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware (Excel Add-ins / Excel Programming) "JDaywalt" wrote in message I have a sheet tab that contains data + one Picture object. I have a macro that allows users to copy/paste this data onto a master sheet tab that may be blank (if it is the first copy), or it may contain previously copied data. Over time, the user will likely use this copy/paste process many times. The issue is that with each copy/paste, the newest version of both the data & picture are copied over the previous. This is no problem for the data as it just overwrites the previous, however, the picture 'pastes' over the top of the old one, leaving each previous version underneath. For example, the first copy will be labeled as 'Picture 1', the next copy will become 'Picture 2', then 'Picture 3', etc. Over time, the file will become huge as each picture object gets stacked on top of the other. What code can I write that will help recognize & delete a previous version of the picture if it exists? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Connect a number to a picture bank and import that picture to exce | Excel Discussion (Misc queries) | |||
How to embed picture that can not be copied or altered? | Excel Discussion (Misc queries) | |||
Insert picture and let it automatically be copied to other sheets | Excel Worksheet Functions | |||
insert a picture in to a comment but picture not save on hard disk | Excel Discussion (Misc queries) | |||
Picture name is changin as worksheet is copied | Excel Programming |