PC Review


Reply
Thread Tools Rate Thread

Custom Command Bars

 
 
Barb Reinhardt
Guest
Posts: n/a
 
      31st Dec 2009
I've figured out a way to add custom commands to the ROWS or CELLS
commandbars, but I only seem to be able to add one. Can someone help me
figure out how to add multiple custom commands to one of those command bars?

Thanks,

Barb Reinhardt

 
Reply With Quote
 
 
 
 
michdenis
Guest
Posts: n/a
 
      31st Dec 2009
Hi,

Copie this in a general module

It's working in Excel 2003 and Excel 2007

'-----------------------------
Sub test()
Dim MBar As CommandBar

Set MBar = Application.CommandBars("Column")
'OR
'Set MBar = Application.CommandBars("Row")
With MBar
With .Controls.Add
.BeginGroup = True
.Caption = "NewCommand1"
.OnAction = "Happy_New_Year"
End With
With .Controls.Add
.Caption = "NewCommand2"
.OnAction = "OK"
End With
End With

End Sub
'-----------------------------
Sub Ok()
MsgBox "Is it working ?"
End Sub
'-----------------------------
Sub Happy_New_Year()
MsgBox "you too"
End Sub
'-----------------------------



"Barb Reinhardt" <(E-Mail Removed)> a écrit dans le message de
groupe de discussion : 060AA00A-FE39-45C8-9007-(E-Mail Removed)...
I've figured out a way to add custom commands to the ROWS or CELLS
commandbars, but I only seem to be able to add one. Can someone help me
figure out how to add multiple custom commands to one of those command bars?

Thanks,

Barb Reinhardt

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom command and Menu bars in Access 2007 =?Utf-8?B?anNyb2dvbA==?= Microsoft Access VBA Modules 5 1st May 2008 11:51 PM
Custom Command Bars barrowhill Microsoft Excel Misc 1 29th Mar 2008 02:19 PM
Command Bars merlynknight@msn.com Microsoft Excel Programming 1 9th Nov 2007 12:39 AM
Running Access 2003 in Access 2007 - Custom Menus and COmmand Bars Aussie Jeff Microsoft Access Form Coding 1 2nd May 2007 01:13 PM
Preventing Users from Modifying Custom Command Bars =?Utf-8?B?VmxhZA==?= Microsoft Excel Programming 1 24th May 2004 08:04 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:52 AM.