LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 134
Default Add standard button on custum commandbar

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
event with commandbar button right-click? RB Smissaert Excel Programming 6 October 13th 05 01:59 PM
Creating a Custom commandbar button sifar Excel Programming 0 September 15th 05 11:27 PM
Dynamic commandbar button problem JB2005 Excel Programming 2 August 28th 05 10:09 AM
static commandbar Button Hari Excel Programming 0 June 22nd 04 10:50 AM
Commandbar button running macro Kwan Kim Chuen Excel Programming 0 July 27th 03 11:51 AM


All times are GMT +1. The time now is 09:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"