Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can I put buttons on a sheet without selecting?
I'd prefer if this macro added the buttons without selecting the sheet. And
even work if another workbook is active. Sub AddButtonsToPage() Application.ScreenUpdating = False ThisWorkbook.Activate Sheets("BondCalc").Select If ActiveSheet.Shapes.Count = 0 Then ActiveSheet.Buttons.Add(400, 20, 170, 23).Select Selection.OnAction = "CopyBondCalcSheet" Selection.Characters.Text = "Put Page Contents into Clipboard" ActiveSheet.Buttons.Add(400, 55, 72, 23).Select Selection.OnAction = "ClearBondCalcSheet" Selection.Characters.Text = "Clear Page" End If Range("A1").Select End Sub Is it possible? Don. www.donwiss.com (e-mail link at home page bottom). |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can I put buttons on a sheet without selecting?
I played around with it and this works. And *much* more elegant.
Sub AddButtonsToPage() Application.ScreenUpdating = False With ThisWorkbook.Sheets("BondCalc") If .Shapes.Count = 0 Then With .Buttons.Add(400, 20, 170, 23) .OnAction = "CopyBondCalcSheet" .Characters.Text = "Put Page Contents into Clipboard" End With With .Buttons.Add(400, 55, 72, 23) .OnAction = "ClearBondCalcSheet" .Characters.Text = "Clear Page" End With End If End With End Sub Don. www.donwiss.com (e-mail link at home page bottom). |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Selecting 3 buttons out of a 3 x 3 array of options. | Excel Discussion (Misc queries) | |||
Selecting Radio Buttons by Using Macros | Excel Programming | |||
Selecting Form buttons | Excel Programming | |||
selecting using option buttons in excel | Excel Worksheet Functions | |||
selecting sheet name in another workbook by variable (same sheet name) | Excel Programming |