
August 29th, 2003, 05:37 AM
|
 |
Gogga
|
|
Join Date: Jul 2003
Posts: 198
Time spent in forums: < 1 sec
Reputation Power: 6
|
|
If you know in which cell the picture is, you can use this code (I hope it works, I had 2 play around it a bit).
Code:
Dim iWidth As Double
Dim iHeight As Double
Dim iDividor As Double
Dim iRest As Double
iDividor = 5.25
iRest = 3.75
'use the index number of the picture in the shapes(index) thingy, e.g. shapes(1) is the first
'picture in that was inserted, shapes(2) the second picture, etc. If all of the pictures are
'the same size, it doesn't matter which one you use.
iHeight = Worksheets(1).Shapes(1).Height
iWidth = Worksheets(1).Shapes(1).Width
'use the cells(irow, icolumn) in which the picture sits
Cells(17, 6).RowHeight = iHeight
Cells(17, 6).ColumnWidth = (iWidth - iRest) / iDividor
If that doesn't work, you can add this code (instead of idividor = 5.25 and irest = 3.75) to get the values (through code) of the dividor and the rest
Code:
Dim iOldWidth As Double
Dim iNormWidth(2) As Double
For i = 1 To 2
Columns("D:D").ColumnWidth = i
iNormWidth(i - 1) = Columns("D:D").Width
Next i
iDividor = iNormWidth(1) - iNormWidth(0)
iRest = iNormWidth(0) - iD
iOldWith = Columns("D:D").ColumnWidth
Columns("D:D").ColumnWidth = iOldWidth
Last edited by Silian : August 29th, 2003 at 05:51 AM.
|