PC Review


Reply
Thread Tools Rate Thread

Common routine for many menu buttons

 
 
Dave D-C
Guest
Posts: n/a
 
      3rd Sep 2007
Hello,
I have 20 ControlButtons on a CommandBar, and the actions are similar,
but a parameter is needed. So I could brute force with 20 routines:
CBControl1.OnAction = "Do1"
CBControl2.OnAction = "Do2"
etc.
Sub Do1()
Call DoAll(1) ' common routine
End Sub
Sub Do2()
Call DoAll(2) ' common routine
End Sub
etc.

Is there a way for a DoAll routine to get the tag or the parameter
from the menu button that was pushed? How does one use
CBControl.Parameter?

TIA, Dave


----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
 
Reply With Quote
 
 
 
 
Jon Peltier
Guest
Posts: n/a
 
      4th Sep 2007
Try this technique from John Walkenbach's site:

http://www.j-walk.com/ss/excel/tips/tip44.htm

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"Dave D-C" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello,
> I have 20 ControlButtons on a CommandBar, and the actions are similar,
> but a parameter is needed. So I could brute force with 20 routines:
> CBControl1.OnAction = "Do1"
> CBControl2.OnAction = "Do2"
> etc.
> Sub Do1()
> Call DoAll(1) ' common routine
> End Sub
> Sub Do2()
> Call DoAll(2) ' common routine
> End Sub
> etc.
>
> Is there a way for a DoAll routine to get the tag or the parameter
> from the menu button that was pushed? How does one use
> CBControl.Parameter?
>
> TIA, Dave
>
>
> ----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet
> News==----
> http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+
> Newsgroups
> ----= East and West-Coast Server Farms - Total Privacy via Encryption
> =----



 
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
Common form.open Routine JimS Microsoft Access Forms 5 9th May 2008 12:17 PM
Creating Forms from a common routine DaveG Microsoft VB .NET 1 4th Oct 2006 10:49 PM
Fast Fourier Transform routine in Tools add-in menu =?Utf-8?B?VHV0b3JndXk=?= Microsoft Excel Worksheet Functions 1 23rd Mar 2006 04:49 PM
Common routine to handle a check box Mike News Microsoft Excel Programming 3 21st Feb 2006 10:18 AM
How can I get common buttons, that I have created, on every page? =?Utf-8?B?THVjeUxlZQ==?= Microsoft Frontpage 5 15th Mar 2005 03:53 PM


Features
 

Advertising
 

Newsgroups
 


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