Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Chip:
Thanks a lot. Works exactly as I intended. AC "Chip Pearson" wrote: Try some code like the following: Sub CreateButton() ' create the button Dim Btn As Excel.Button Dim WS As Worksheet Set WS = Worksheets("Sheet1") Set Btn = WS.Buttons.Add(Top:=50, Left:=100, Width:=40, Height:=20) With Btn .Caption = "Click Me" .OnAction = "'" & ThisWorkbook.Name & "'!TheProc" End With End Sub Sub TheProc() ' called with button is clicked. MsgBox "Hello World" End Sub Cordially, Chip Pearson Microsoft MVP Excel Product Group Pearson Software Consulting, LLC www.cpearson.com (email on web site) On Wed, 17 Dec 2008 12:50:08 -0800, AndrewCerritos wrote: Hi, could anybody give me some hint or example on how to create button on the fly on a worksheet? AndrewCerritos |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I create button to printout worksheet range in excel 2007? | Excel Discussion (Misc queries) | |||
Programmatically create button on Excel worksheet (vb.net) | Excel Programming | |||
How to create a drop down button on a worksheet? | Excel Worksheet Functions | |||
I would like to create a button on the worksheet to work a macro | Excel Programming | |||
How can I create a button to save one worksheet into a new workshe | Excel Discussion (Misc queries) |