LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 371
Default Avoiding verbose code

Hi
Two custom menu buttons execute the same basic code but with one additional
function provided by the second button.
To avoid repeating the basic (lengthy) code in two modules it would be great
if I could detect which button was selected.
If this is possible then, noting the additional function is executed part
way through the basic code, the pseudo code would look like this:

Sub MenuSetUp()
btn1.OnAction = "MainProc"
btn2.OnAction = "MainProc"
End Sub

Sub MainProc()
basic code
If btn2 selected then do additional function
rest of basic code
End Sub

I'm guessing each button must have a click event to trigger its OnAction
statement but how do I trap this? I'd appreciate any help on this.

Geoff


 
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
Avoiding #N/A gibbylinks Excel Discussion (Misc queries) 8 February 6th 10 12:51 PM
Avoiding #N/A Heather Excel Discussion (Misc queries) 4 August 25th 09 08:41 PM
Avoiding page breaks across merged cells - Code not working as expected Alan Excel Programming 2 September 26th 05 03:55 AM
Avoiding #NUM! Bruno Campanini Excel Worksheet Functions 9 September 14th 05 02:34 PM
Avoiding 400 Error code nospaminlich Excel Programming 2 February 2nd 05 07:55 PM


All times are GMT +1. The time now is 11:02 AM.

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"