Macro x inserire immagini
Buongiorno,
sto usando la macro che c'è ad inizio del post e funziona su PC perfettamente, avendo file ed immagini nella stessa cartella.
Allego la macro usata:
Sub InsImg()
Application.ScreenUpdating = False
ActiveSheet.Shapes.SelectAll
Selection.Delete
mPath = ActiveWorkbook.Path
r = 2 ' riga inizio prodotti
Lr = Range("A" & Rows.Count).End(xlUp).Row ' ultima riga da analizzare
For i = r To Lr
mFoto = Cells(i, 1)
If Len(mFoto & "") <> 0 Then ' se c'e' il nome prodotto
If Dir(mPath & "\" & mFoto & ".jpg") <> "" Then ' se la foto esiste
' inserisce foto e adatta a dimensioni cella/colonna B
With ActiveSheet.Pictures.Insert(mPath & "\" & mFoto & ".jpg")
'NOTA: in blu per centrare la foto nelle celle (puoi ovviamente variare), altrimenti vengono una attaccata all'altra
.Top = Range("B" & i).Top + 5
.Left = Range("B" & i).Left + 5
.Height = Range("B" & i).Height - 10
.Width = Range("B" & i).Width - 10
End With
End If
End If
Next i
Application.ScreenUpdating = True
End Sub
Vorrei sapere come poter inserire più di 1 immagine avente lo stesso nome EX:
COL-A COL-B COL-C COL-D
112233 112233.jpg 112233_1.jpg 112233_2.jpg
Sono tutte nominate con lo stesso nome della colonna A ma hanno _1 _2 etc...
Ringrazio anticipatamente chiunque voglia dedicare del tempo!
Ciao
Emanuele