Try adding:
to:
Code:
Dim i As Long, j As Long, c As Long, r As Long, NumCols As Long, iShp As InlineShape
inserting:
Code:
Aspect = RwHght > ColWdth
before:
and changing:
Code:
With iShp
.LockAspectRatio = True
If (.Width < ColWdth) And (.Height < RwHght) Then
.Width = ColWdth
If .Height > RwHght Then .Height = RwHght
End If
End With
Code:
With iShp
.LockAspectRatio = True
If (.Height > .Width) <> Aspect Then
Set Shp = .ConvertToShape
Shp.Rotation = 90
Shp.ConvertToInlineShape
End If
End With
Set iShp = oTbl.Cell(r, c).Range.InlineShapes(1)
With iShp
If (.Width < ColWdth) And (.Height < RwHght) Then
.Width = ColWdth
If .Height > RwHght Then .Height = RwHght
End If
End With