Resize Shape

galileogali

Well-known Member
Joined
Oct 14, 2005
Messages
748
I have got a Image (on Worksheet):
ActiveSheet.Shapes("Image 1")
and

wdt = Range("A1").ColumnWidth
hgt = Range("A1").RowHeight

How do I get to match the shape sizes to the size of the cell?

ActiveSheet.Shapes("Image 1").Width = wdt
ActiveSheet.Shapes("Image 1").Height = hgt

In this way does not work well
 

Some videos you may like

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
Try

Code:
Sub piccy()
With ActiveSheet.Shapes("Image 1")
    .LockAspectRatio = False
    .Top = Range("A1").Top
    .Left = Range("A1").Left
    .Height = Range("A1").RowHeight
    .Width = Range("A1").Width
End With
End Sub
 

galileogali

Well-known Member
Joined
Oct 14, 2005
Messages
748
.LockAspectRatio = False "Braaaaaavo!!!!!!

Vog: sincerely: Thank you very,very much....

Regards
 

Watch MrExcel Video

Forum statistics

Threads
1,108,978
Messages
5,526,014
Members
409,675
Latest member
audeser

This Week's Hot Topics

Top