View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Macro for variable picture


PictureNumber = 137
PictureName = "Picture " & PictureNumber

Sheets("Actions").Select
Range("B16").Select
sImageToLoad = Sheets("Macros").Range("A2")
ActiveSheet.Pictures.Insert (sImageToLoad)
ActiveSheet.Shapes (PictureName)
Selection.ShapeRange.ScaleWidth 1.34, msoFalse,
msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 1.34, msoFalse,
msoScaleFromTopLeft


"_Nate" wrote:

....
Sheets("Actions").Select
Range("B16").Select
sImageToLoad = Sheets("Macros").Range("A2")
ActiveSheet.Pictures.Insert (sImageToLoad)
ActiveSheet.Shapes ("Picture 37")
Selection.ShapeRange.ScaleWidth 1.34, msoFalse,
msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 1.34, msoFalse,
msoScaleFromTopLeft
....

I need help with the proper format to make "Picture 37" a variable in
the function. Each time this step is run in large macro, the picture
number changes.

Many thanks in advance.
_Nate