When in doubt, record a macro that does what your trying to accomplish, then
edit the code to suit your needs, great way to learn and help you remember
long forgotten functionality. This is what recorded when I added a button.
Can't get much better.
ActiveSheet.OLEObjects.Add(ClassType:="Forms.CommandButton.1", Link:=False _
, DisplayAsIcon:=False, Left:=79.5, Top:=135.75, Width:=64.5, Height _
:=25.5).Select
-John
"mark kubicki" wrote:
> I know that:
> Set Mycmd = Controls.Add("MSForms.CommandButton.1") ', CommandButton2,
> Visible)
> will add a control to a form
>
> what would the code be to add a control to a worksheet? (are there any
> tricks I will need to do to make it functional (de-activate / activate
> worksheet...))
>
> thanks in advance
> mark
>
>
>
|