Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to call subprocedure from within procedure?
i'm coding a dialog that has 2 different selection methods, but the calculation is the same for both (i.e. different inputs, same calculation method). i'm trying to streamline it by creating one section called private sub calculate(), and then calling this at the end of the other procedures. this is in the same userform as the other ones. i typed: Code: -------------------- call calculate -------------------- at the end of both procedures, and only one of my selection methods worked. the other appears to stop just before the procedure call (stops at the last step before it). what happened? thanks. -- dreamz ------------------------------------------------------------------------ dreamz's Profile: http://www.excelforum.com/member.php...o&userid=26462 View this thread: http://www.excelforum.com/showthread...hreadid=480621 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to call subprocedure from within procedure?
Can't stop before executing this, at least not without an error. Perhaps you
have error handling that suppresses the error, either in main code or in subroutine. Would need to see more of the code and know why you say it stops before the sub - how do you know? Try putting a breakpoint in the sub and you will find out if it is being executed or not when it brings you into the debugger. Then maybe you can find out what is happening. -- - K Dales "dreamz" wrote: i'm coding a dialog that has 2 different selection methods, but the calculation is the same for both (i.e. different inputs, same calculation method). i'm trying to streamline it by creating one section called private sub calculate(), and then calling this at the end of the other procedures. this is in the same userform as the other ones. i typed: Code: -------------------- call calculate -------------------- at the end of both procedures, and only one of my selection methods worked. the other appears to stop just before the procedure call (stops at the last step before it). what happened? thanks. -- dreamz ------------------------------------------------------------------------ dreamz's Profile: http://www.excelforum.com/member.php...o&userid=26462 View this thread: http://www.excelforum.com/showthread...hreadid=480621 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to call subprocedure from within procedure?
K Dales Wrote: Can't stop before executing this, at least not without an error. Perhaps you have error handling that suppresses the error, either in main code or in subroutine. i doubt it, seeing as how i'm a beginner and don't know how to do that. :D Would need to see more of the code and know why you say it stops before the sub - how do you know? the calculate procedure copies a list and pastes it into certain worksheets and vlookups to populate the sheets. i know the calculate procedure isn't run because those sheets aren't populated. i can easily see that the list hasn't been pasted. Try putting a breakpoint in the sub and you will find out if it is being executed or not when it brings you into the debugger. Then maybe you can find out what is happening. how do i do that? i tried putting in something (msgbox "done") after the procedure call and ran it. the message box popped up, without any error, which means the the procedure finished, but still, nothing was copied over (calculate procedure didn't work). i don't get it. the calculate procedure works when it is called from the other procedure. i don't see why it doesn't work here. -- dreamz ------------------------------------------------------------------------ dreamz's Profile: http://www.excelforum.com/member.php...o&userid=26462 View this thread: http://www.excelforum.com/showthread...hreadid=480621 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to call subprocedure from within procedure?
Hello dreamz, When you say stops, did the call to the proccedure not execute, or did it generate an error? You should also post the code for Calculate. Thanks, Leith Ross -- Leith Ross ------------------------------------------------------------------------ Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465 View this thread: http://www.excelforum.com/showthread...hreadid=480621 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Call Procedure | Excel Programming | |||
Where else to look for procedure call | Excel Programming | |||
Where else to look for procedure call | Excel Programming | |||
call procedure | Excel Programming | |||
procedure won't call | Excel Programming |