Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Commandbar button running macro

I have these code in the VBA. This code works and create
the controls on my command bar to run the respective
macros. However, the name of the assigned macros were
preceeded with the spreasheet's name, except for the last
created control. How do I make the other controls behave
like the last one.

Set buttonSix = MyBar.Controls.Add
(Type:=msoControlButton)
With buttonSix
'.FaceId = 133
.Caption = "Print Costing Section"
.Style = msoButtonCaption
.BeginGroup = True
.OnAction = "Printcosting"
End With
Set buttonOne = MyBar.Controls.Add
(Type:=msoControlButton)
With buttonOne
'.FaceId = 133
.Caption = "Show/Hide Unit/Total Price"
.Style = msoButtonCaption
.Tag = "EasyEntry"
.BeginGroup = True
.OnAction = "EasyEntry"
End With
Set buttonTwo = MyBar.Controls.Add
(Type:=msoControlButton)
With buttonTwo
'.FaceId = 133
.Caption = "Checking"
.Style = msoButtonCaption
.BeginGroup = True
.OnAction = "!SanityCheck"
End With

Reply
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
How to exchange Custom Commandbar buttons between PC's? Frank Van Eygen[_2_] Excel Discussion (Misc queries) 3 April 10th 09 01:01 PM
In-place CommandBar.Add run-time error ARHangel Excel Discussion (Misc queries) 4 October 11th 07 06:17 AM
Running a Macro through a button vs. VBA [email protected] Excel Discussion (Misc queries) 2 August 31st 07 08:00 PM
commandbar problems Richard Cook Excel Discussion (Misc queries) 1 July 8th 05 05:32 PM
Controlling Font Name in a personnal Commandbar Luc Dansereau Excel Programming 0 July 12th 03 07:44 PM


All times are GMT +1. The time now is 12:01 PM.

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

About Us

"It's about Microsoft Excel"