I have attempted to create a macro that resizes a picture based on the length and width of merged cells. I've ran into two problems: it only works on one picture per sheet (i.e., it will not let me run the same macro on a different picture but will instead resize the first picture again), and it does not fully fit the merged cells. I'm not sure about the first problem, but it seems it's not counting all the rows and columns when calculating the height and width. Any input would be great help!

Sub Resize()
Dim r As Range
Set r = Application.InputBox("Click in the cell to hold the picture", Type:=8)
On Error GoTo 0
If r Is Nothing Then Exit Sub
If r.Count > 1 Then Exit Sub
ActiveSheet.Select
With ActiveSheet.Shapes(ActiveSheet.Shapes.Count)
.LockAspectRatio = True
.Top = r.Top
.Left = r.Left
.Height = r.RowHeight * r.MergeArea.Rows.Count
.Width = r.ColumnWidth * r.MergeArea.Columns.Count
End With
End Sub