
Sub caricaAccantoAlNome() ' foglio1
Dim cell, shp As Shape
fpath = "D:pippo"
Set Rng = ActiveSheet.Range("a2:a4") ' nomi delle foto
For Each cell In Rng
nomefile = fpath & cell & ".jpg"
cell.Offset(0, 1).Select
ActiveSheet.Pictures.Insert(nomefile).Select
With Selection.ShapeRange.Item(1)
.LockAspectRatio = msoTrue
.Width = 50
.Height = 50
End With
Next
End Sub |
Sub a()
Dim cell, shp As Shape
fpath = "D:pippo"
Set Rng = ActiveSheet.Range("a16:a19") ' nomi
For Each cell In Rng
nomefile = fpath & cell & ".jpeg"
cell.Offset(0, 34).Select
w = Selection.Width
h = Selection.Height
ActiveSheet.Pictures.Insert(nomefile).Select
With Selection.ShapeRange.Item(1)
.LockAspectRatio = msoTrue
.Width = w
.Height = h
End With
Next
End Sub
|
