Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
This newsgroup is great, I've been using it frequently. Thank you My problem is that I'm using the code from http://www.mcgimpsey.com/excel/lookuppics.html to insert pictures in a worksheet according to a cell value, my chart is on a separate sheet to lookup the picture number, however when I copy the sheet, the pictures chage numbers, causing the wrong pictures to be called out. Any idea what is happening, I tried copying to new sheets with the test file that's on the McGimpsey site, and the picutes keep their corresponding number. Thanks in advance |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Indeed if you copy shapes (which include Pictures) to another sheet the
original Excel assigned name will change, to say Picture x. X increments with the number of shapes that have ever been added to the sheet since the sheet was saved with zero shapes.. Shapes have two names, the Excel assigned name and one that you can assign yourself, manually in the box on the input bar or with code. If you name the shape first, when you come to copy to another sheet myName will persist. So for your purposes name the Pictures before copying to other sheets. Be careful because for some strange reason Excel permits shapes with duplicate myName on the same sheet. Sub test() Dim pic As Picture For Each pic In ActiveSheet.Pictures i = i + 1 pic.Name = "myName_" & Format(i, "00") Next End Sub If by chance you had duplicate myNname's you might be surprised to find you need to run the above more than once. Regards, Peter T "Franky" wrote in message ... Hi, This newsgroup is great, I've been using it frequently. Thank you My problem is that I'm using the code from http://www.mcgimpsey.com/excel/lookuppics.html to insert pictures in a worksheet according to a cell value, my chart is on a separate sheet to lookup the picture number, however when I copy the sheet, the pictures chage numbers, causing the wrong pictures to be called out. Any idea what is happening, I tried copying to new sheets with the test file that's on the McGimpsey site, and the picutes keep their corresponding number. Thanks in advance |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to embed picture that can not be copied or altered? | Excel Discussion (Misc queries) | |||
Changin a Macro so it automatically updates the active worksheet. | Excel Discussion (Misc queries) | |||
Insert picture and let it automatically be copied to other sheets | Excel Worksheet Functions | |||
How to extract a picture from an Excel worksheet into a picture fi | Excel Discussion (Misc queries) | |||
How name a copied worksheet? | Excel Programming |