Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
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
Call Procedure Ronbo Excel Programming 4 February 23rd 05 08:11 PM
Where else to look for procedure call Lulu Excel Programming 0 November 24th 04 03:07 PM
Where else to look for procedure call Lulu Excel Programming 2 November 24th 04 02:14 AM
call procedure bob Excel Programming 1 August 9th 03 12:40 AM
procedure won't call John Gittins Excel Programming 0 August 5th 03 08:17 PM


All times are GMT +1. The time now is 10:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"