PC Review


Reply
Thread Tools Rate Thread

Delete earlier 'Picture' version when new picture copied in

 
 
JDaywalt
Guest
Posts: n/a
 
      21st Mar 2008
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 With Quote
 
 
 
 
Jim Cone
Guest
Posts: n/a
 
      22nd Mar 2008

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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I delete a picture in powerpoint? (Background picture) =?Utf-8?B?R3JvZW5pZQ==?= Microsoft Powerpoint 1 2nd Jun 2006 02:55 PM
Re: Any freeware?Where this picture is taken(copied) from? Boco Merco Freeware 0 7th Jun 2004 08:54 AM
Re: Any freeware?Where this picture is taken(copied) from? Ceg Freeware 0 7th Jun 2004 05:38 AM
Document being copied from floppy gets wiped out by an earlier version of itself Larry Microsoft Word New Users 0 28th Mar 2004 10:04 PM
Document being copied from floppy gets wiped out by an earlier version of itself Larry Microsoft Word Document Management 0 28th Mar 2004 10:04 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:27 PM.