
Sub Picture_change()
ActiveSheet.Shapes.Range(Array("Picture 4")).Select
Selection.Placement = xlMoveAndSize
Selection.ShapeRange.LockAspectRatio = msoFalse
Selection.ShapeRange.Height = 39.6850393701
Selection.ShapeRange.Width = 53.8582677165
Selection.ShapeRange.LockAspectRatio = msoTrue
End Sub |
Sub prova()
Dim shp As Shape
For Each shp In ActiveSheet.Shapes
shp.Placement = xlMoveAndSize
shp.Locked = False
shp.Height = 39.6850393701
shp.Width = 53.8582677165
shp.Locked = True
Next shp
End Sub
|
activesheet.shapes("immagine 7").left=range("e1").left+range("e1").Width2-activesheet.shapes("immagine 7").width2
For Each shp In Selection
Sub centra()
Dim shp As Shape
r = 1: c = 1
For Each shp In ActiveSheet.Shapes
If Left(shp.Name, 3) = "Pic" Then
shp.Locked = False
shp.Height = 20
shp.Width = 30
shp.Locked = True
With Cells(r, c)
shp.Left = .Left + .Width 2 - shp.Width 2
shp.Top = .Top + .Height 2 - shp.Height 2
End With
r = r + 1
End If
Next shp
End Sub |
shp.Top = .Top + .Height 2 - shp.Height 2(e in fondo così torniamo al mio codice postato all'inizio della discussione) così le immagini si collocano al centro della cella dove si trovano ora.
