PDA

View Full Version : Solved: reset picture# in Excel



slang
05-13-2010, 08:49 AM
Just a quick one guys/gals.

I have a sheet where the user will be inserting two pictures but I want to resize and move them to specific areas.
I have that part working but how can I either stop reset the default picture# from incrementing or a quick way to reference the two pictures objects on the sheet.Picture 79??


ActiveSheet.Shapes("Picture 79").Select
With Selection.ShapeRange
.IncrementLeft 380.25
.IncrementTop 2.25
.ScaleWidth 0.89, msoFalse, msoScaleFromTopLeft
.ScaleHeight 0.89, msoFalse, msoScaleFromTopLeft
End With

Thanks again

Zack Barresse
05-13-2010, 09:23 AM
Hi there,

You could check to see the TopLeft property to see where the picture resides. Not really sure about any other specifics, i.e. do you have more than one picture on the sheet, etc. If they are the two newest you could loop through the pictures and get the last incrimented picture number. Or loop backwards through the index numbers of them and grab the first two in your loop.

HTH

slang
05-13-2010, 03:19 PM
How do you reference the picture objects on the sheet?
I am a bit rusty at coding, do you have an example of how to loop through pictures on a sheet as a starting point.
Once I get that I should be ok.
Just back from vac and the head is dead.....:mkay

Zack Barresse
05-14-2010, 01:44 PM
Pictures are part of the Shapes collection. So Worksheet("SheetName").Shapes(1) Should work I think. Do you have a sample file you could upload?