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

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

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,109,084
Messages
5,526,755
Members
409,717
Latest member
Oscarsalone

This Week's Hot Topics

Top