View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
justme justme is offline
external usenet poster
 
Posts: 68
Default Insert picture, resize to specific width, keeping height propo


Thanks Carlo for the explanation and for the code tightening. I need that
last line because it is part of how I position the picture by lining up the
lower left corner to the lower left corner of a cell.

:)

"Carlo" wrote:

Floating Point means decimal point.

So, if you want to use decimal point you can choose between:
double and single

if you want to have whole numbers you can choose between all the rest
(including single and double)

Hope that I spoke in lay terms, as I am also a lay ;)

For your Resize sub you can shorten it to:
----------------------------------------------------------
SUMFB.Activate
'i'm not sure, if you really need to select this cell!
SUMFB.Cells(15, 16).Select '''VARIABLE PRM
Set pSketch = SUMFB.Pictures.Insert("C:\Documents and Settings\Olab\My
Documents\0- Wear Testing\Sketches\" & sStyle & ".jpg") '''VARIABLE PRM
With pSketch
PicRatio = .Width / .Height
.Width = 240
.Height = .Width * PicRatio
'not sure, what you want to achieve with the following line
.Top = .Top - .Height + 1
End With
----------------------------------------------------------

hth

Carlo