Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for your help, Leith,
Jos "Leith Ross" schreef in bericht ... Hello Jos, Here is a code example taken from the VBA help files. Thiss adds a button to a custom toolbar to execute the Excel toolbar AutoSum. This Microsoft Excel example creates a command bar and then adds a built-in command bar button control to it. The button executes the Excel AutoSum function. This example uses the Execute method to total the selected range of cells when the command bar appears. Code: -------------------- Dim cbrCustBar As CommandBar Dim ctlAutoSum As CommandBarButton Set cbrCustBar = CommandBars.Add("Custom") Set ctlAutoSum = cbrCustBar.Controls _ .Add(msoControlButton, CommandBars("Standard") _ .Controls("AutoSum").Id) cbrCustBar.Visible = True ctlAutoSum.Execute -------------------- Sincerely, Leith Ross -- Leith Ross ------------------------------------------------------------------------ Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465 View this thread: http://www.excelforum.com/showthread...hreadid=480655 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
event with commandbar button right-click? | Excel Programming | |||
Creating a Custom commandbar button | Excel Programming | |||
Dynamic commandbar button problem | Excel Programming | |||
static commandbar Button | Excel Programming | |||
Commandbar button running macro | Excel Programming |