View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] marc747@excite.com is offline
external usenet poster
 
Posts: 55
Default Crop pictures in excel,,,


Hi,
I have a Macro that inserts pictures in excel, but my pictures are
some in different sizes some have the width long and some the height
is long.
What I need is a macro that sizes the pictures. If the width is longer
than the height then CROP the width from the RIGHT and the LEFT to the
same size as the Height.
And same for the height, if the Height is longer than the width then
Crop from the TOP and the BOTTOM to the same size as the Width.
This is the part of the Macro that I have now.

If Pict.Width Pict.Height Then
Crop = (CellWidth - Pict.Width) / 2
Pict.ShapeRange.PictureFormat.CropLeft = 150
Pict.ShapeRange.PictureFormat.CropRight = 150
Else
Crop = (CellHeight - Pict.Height) / 2
Pict.ShapeRange.PictureFormat.CropTop = 150
Pict.ShapeRange.PictureFormat.CropBottom = 150
End If