Sub FindControlID()
Dim B As Object, Nb As Integer
Nb = Application.CommandBars.Count
[A1].Resize(, 2).Value = Array("Caption", "ID")
For X = 1 To Nb
For Each B In Application.CommandBars.Item(X).Controls
With [A65536].End(xlUp).Offset(1)
.Value = B.Caption
.Offset(, 1).Value = B.ID
End With
Next
Next
Range("A1:B1").EntireColumn.AutoFit
Set a = Nothing: Set B = Nothing
End Sub