View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Susan Susan is offline
external usenet poster
 
Posts: 1,117
Default Resizing a Picture

good! yes, as to the problem you're having, remove this statement:

ActiveSheet.Shapes("Picture 21").Select

every time you add a shape or a picture, excel gives it a different
#. it's hard to keep track of them, because if you delete, say,
picture15, the next one inserted will not be another picture15, but
will be picture22 (or whatever # comes after the last one you
inserted).

if you take that line out, you can select a picture, any picture, and
run the macro, & it will reshape that one picture.
so if you add this macro to a toolbar button, you can select the
picture, and push the button, & it will reshape it.

hope this helps!
susan



On Mar 28, 8:34 am, Longbow wrote:
Hi Susan,

Thanks for your reply. I ran the following macro and received a
run-time error stating that the item with the specified name could not
be found.

Sub Macro3()
'
' Macro3 Macro
' Macro recorded 28/03/2007 by User
'

'
ActiveSheet.Shapes("Picture 21").Select
Selection.ShapeRange.ScaleWidth 2.48, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 2.48, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 1.02, msoFalse, msoScaleFromTopLeft
End Sub

The first line of my macro code will not run according to the VBE that
highlights it in yellow after I debug the run-time error.

Could you please advise on how I can get around this problem.

Many thanks,

Chris.

Live Long and Prosper :-)

*** Sent via Developersdexhttp://www.developersdex.com***