Sub InsFoto() mFile = ActiveWorkbook.Path & "\MiaFoto.jpg" nRighe = Range("D4").MergeArea.Rows.Count nColonne = Range("D4").MergeArea.Columns.Count Range("D4").Select Selection.UnMerge With ActiveSheet.Pictures.Insert(mFile) .ShapeRange.LockAspectRatio = msoFalse mTop = ActiveCell.Top mLeft = ActiveCell.Left mHeight = Range(ActiveCell.Address & ":" & ActiveCell.Offset(5).Address).Height mWidth = Range(ActiveCell.Address & ":" & ActiveCell.Offset(, 2).Address).Width .Top = mTop .Left = mLeft .Width = mWidth .Height = mHeight End With Range(ActiveCell.Address & ":" & ActiveCell.Offset(5, 2).Address).Merge End Sub
Marius44, 03/03/2023 11:11:Buongiorno a tutti Confermo che la macro di @dodo47 (ciao Domenico) è perfettamente funzionante. Forse (e ripeto forse) la adatterei a 6 righe e DUE colonne (attualmente adatta la foto a 6 righe e TRE colonne) Ciao, Mario
Sub InsFoto() On Error GoTo RigaErrore ....... ....... Selection.UnMerge If Dir(mfile) = "" Then MsgBox "immagine non trovata" Image46.Picture = LoadPicture("") Sheets("PP").Select Exit Sub End If With ActiveSheet.Pictures.Insert(mfile) ....... ....... Range(ActiveCell.Address & ":" & ActiveCell.Offset(5, 2).Address).Merge Exit Sub RigaErrore: MsgBox Err.Number & " - " & Err.Description End Sub