Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This is very basic but it should give you a start... this code needs to be in
a standard code module. Private Const MyBarName As String = "My Command Bar" Public Sub AddMyBar() Dim cbrMyBar As CommandBar Dim btn As CommandBarButton Set cbrMyBar = Application.CommandBars.Add(MyBarName) cbrMyBar.Visible = True Set btn = cbrMyBar.Controls.Add(Type:=msoControlButton) With btn .Style = msoButtonCaption .Caption = "Tada" .OnAction = "DoStuff" End With End Sub Public Sub DeleteMyBar() On Error Resume Next Application.CommandBars(MyBarName).Delete End Sub Public Sub DoStuff() MsgBox "Stuff" End Sub -- HTH... Jim Thomlinson "kev_06" wrote: It's come to my attention that I have no idea how to add command buttons to a commandbar. -- kev_06 ------------------------------------------------------------------------ kev_06's Profile: http://www.excelforum.com/member.php...o&userid=35046 View this thread: http://www.excelforum.com/showthread...hreadid=551659 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Floating command button | Excel Discussion (Misc queries) | |||
Create floating button based on button click in menu | Excel Programming | |||
How can I create a Floating Command Button | Excel Programming | |||
My Command Buttons keep floating on the sheet??? | Excel Programming | |||
Floating Command Button - How to??? | Excel Programming |