Sub FitRowHeightByHeightPicture()
On Error Resume Next
Application.ScreenUpdating = False
With ActiveSheet
Dim Sh As Worksheet, rg
Set Sh = ActiveSheet
Set rg = Sh.Range("A1").Resize(10000)
With .Sort
.SortFields.clear
.SortFields.Add2 key:=rg, SortOn:=xlSortOnValues, order:=xlAscending, DataOption:=xlSortNormal
.SetRange rg.Resize(, 6)
.Header = xlYes
.matchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Dim o
for each o in .Pictures
With o.TopLeftCell
.EntireRow.RowHeight = o.Height + 3 + o.top - .top
End With
Next
End with
Application.ScreenUpdating = true
End Sub