I have written some code in Module 2
When I try and run it either with F5 or from Run; Run Sub/UserForm
It displays the Macro dialogue box
My code isn't listed
How do I run my Sub??
Help please
I have written some code in Module 2
When I try and run it either with F5 or from Run; Run Sub/UserForm
It displays the Macro dialogue box
My code isn't listed
How do I run my Sub??
Help please
Last edited by barryleajo; 07-23-2010 at 04:48 AM.
Does your routine take any arguments? Did you click inside the routine code before pressing f5?
Everyone who confuses correlation and causation ends up dead.
Hi Romperstomper
Many thanks for your quick response
Yes the routine takes arguments which I have set up just before the Sub...code
I have even tried putting a Call Sub..... before the Sub code.
Yes I have put the cursor inside the Sub code to no avail.
There is no other Subs inside Module 2 in this workbook
There are other Subs in Module 1 in the same workbook
The effect is to display the select Macros dialogue box when I try to run it
There are three Subs (from Module 1) listed in the Selec/Run Macro dialogue
Tow of these I created using Macro Recorder
the third I didn't so don't know how or why it appears here
Confused!!
If your sub takes arguments, you cannot run it directly - you need another sub that calls that sub and passes the required values to it.
OK I understand that - thanks
My problem is before that
I don't even get into the Run because of the Select Macro dialogue box automatically opening
As I said, you can't run that directly. If you try, you will get the macros dialog instead. You need to create another sub that calls your sub. For example:
![]()
Please Login or Register to view this content.
If you put the cursor in macro1 and press f5 you will get the select macros dialog. If you put the cursor in Macro2 and press f5 it will run and call macro1.
Does that help?
Got it shg
Thanks for your patience.
In fact I REM'd out the arguments and "hardwired" them into the Sub for testing purposes
It acted just as you have said
Great and thanks.
How do I mark this query as Solved?
I' m not shg.
How to mark a thread Solved
Go to the first post
Click edit
Click Go Advanced
Just below the word Title you will see a dropdown with the word No prefix.
Change to Solved
Click Save
Er...how embarrassing and profuse apols
shg has been responding to me on another query
Thanks for the advice and I have marked my query as SOLVED
Just for completeness given that you are a moderator would you mark my previous post "Controlling display position" as SOLVED please.
If you hadn't responded to me how would I contact a moderator on the forum?
With thanks romperstomper!!!!
See the How To links at the top of this page.![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks