[font=Verdana][color=darkblue]Option[/color] [color=darkblue]Explicit[/color]
[color=darkblue]Sub[/color] test()
[color=darkblue]Dim[/color] OleObj [color=darkblue]As[/color] OLEObject
[color=darkblue]Dim[/color] Cnt [color=darkblue]As[/color] [color=darkblue]Long[/color]
[color=darkblue]For[/color] [color=darkblue]Each[/color] OleObj [color=darkblue]In[/color] ActiveSheet.OLEObjects
[color=darkblue]If[/color] TypeName(OleObj.Object) = "CommandButton" [color=darkblue]Then[/color]
Cnt = Cnt + 1
[color=darkblue]End[/color] [color=darkblue]If[/color]
[color=darkblue]Next[/color] OleObj
MsgBox "Number of CommandButtons: " & Cnt
[color=darkblue]End[/color] [color=darkblue]Sub[/color]
[/font]