Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default function to figure out which procedure

i need to create a function that will figure out which procedure called it
and then run the appropriate procedure based on that call.

re-wording...:::
i have several procedures that will call the same procedure.
depending on the procedure calling the procedure, another procedure is called.

or this can be done with a function... and then i will produce the results
and the procedure name

any help will be appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 644
Default function to figure out which procedure

Monique, add an optional string to your function.
Function XYZ(Parameters as Variant, Optional Caller as String) as
Integer
'Your code
End Function

Then call it like this:
i = XYZ(Param1, "MySub")

Charles Chickering

Monique wrote:
i need to create a function that will figure out which procedure called it
and then run the appropriate procedure based on that call.

re-wording...:::
i have several procedures that will call the same procedure.
depending on the procedure calling the procedure, another procedure is called.

or this can be done with a function... and then i will produce the results
and the procedure name

any help will be appreciated.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 415
Default function to figure out which procedure

Monique,
The only practical way is to have an argument in your called function that
take the name of the calling routine.
Then based your the call to subsequent routines based on that.

Function Calling
Call Called ("Calling")
End Function

Function Called (WhoCalledMe As String)
Select Case WhoCalledMe
Case "Calling"
'Decide what to do
Case Else
MsgBox "No folllowing routine specified"
End Select
End Function

NickHK

"Monique" ...
i need to create a function that will figure out which procedure called it
and then run the appropriate procedure based on that call.

re-wording...:::
i have several procedures that will call the same procedure.
depending on the procedure calling the procedure, another procedure is
called.

or this can be done with a function... and then i will produce the results
and the procedure name

any help will be appreciated.



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
Can't figure out the Function I need! slober Excel Discussion (Misc queries) 4 October 7th 09 10:47 AM
need to figure out an equation / function monkeytrader Excel Worksheet Functions 1 February 12th 07 05:08 AM
Is their any Function to convert no. in figure to in words Dhirru Excel Worksheet Functions 2 February 4th 06 07:09 PM
Index function works in A2, but not in A10, Why is that? Cant figure it out. sonar Excel Worksheet Functions 8 August 28th 05 07:44 PM
NEED HELP! Cannot figure out complex function tiger Excel Worksheet Functions 10 August 15th 05 08:18 PM


All times are GMT +1. The time now is 06:47 PM.

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"