Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Connect a number to a picture bank and import that picture to exce Dennis Hedo Excel Discussion (Misc queries) 1 March 22nd 10 02:17 PM
How to embed picture that can not be copied or altered? joromajr Excel Discussion (Misc queries) 3 July 19th 08 09:49 PM
Insert picture and let it automatically be copied to other sheets Aron Excel Worksheet Functions 5 September 24th 07 12:40 PM
insert a picture in to a comment but picture not save on hard disk Pablo Excel Discussion (Misc queries) 0 February 21st 07 03:48 PM
Picture name is changin as worksheet is copied Franky Excel Programming 1 April 18th 06 05:59 PM


All times are GMT +1. The time now is 04:53 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"