You would need to select two shapes (Only one of which can hold text.)
Sub aligner()
'only works for 2 shapes
' only one shape can hold text
Dim oshp1 As Shape
Dim oshp2 As Shape
If ActiveWindow.Selection.ShapeRange.Count <> 2 Then
MsgBox "Select exactly two shapes", vbCritical
Exit Sub
End If
If ActiveWindow.Selection.ShapeRange(1).HasTextFrame Then
Set oshp1 = ActiveWindow.Selection.ShapeRange(1)
Set oshp2 = ActiveWindow.Selection.ShapeRange(2)
Else
Set oshp2 = ActiveWindow.Selection.ShapeRange(1)
Set oshp1 = ActiveWindow.Selection.ShapeRange(2)
End If
With oshp1
.TextFrame2.AutoSize = msoAutoSizeNone
.TextFrame2.VerticalAnchor = msoAnchorMiddle
.TextFrame2.TextRange.ParagraphFormat.Alignment = msoAlignCenter
.Left = oshp2.Left
.Top = oshp2.Top
.Width = oshp2.Width
.Height = oshp2.Height
End With
End Sub