Creating a Button


Posted by Michael on January 15, 2002 6:23 AM

I need help creating a button in VB. After a particuler piece of code executes, I need to then have a button created on a worksheet, and a macro assigened to it. Any help on this is appreciated.

Posted by bob Umlas on January 15, 2002 6:56 AM

Set MyButton = Activesheet.Buttons.Add (20,30,40,50) '#s are top, left, height, width
MyButton.Onaction = "RunThisCodeWhenClicked"
...
...
Sub RunThisCodeWhenClicked()
...
End Sub



Posted by Michael on January 15, 2002 10:21 AM

Thank you

Thank you, that worked great.