Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Calling Sub / Called Sub
Scenario..
I have two Subs: sub A and sub B. sub A calls sub B where sub B has functionality to determine a true or false. I want to pass a value (in this case a true or false back to the calling sub (sub A). How do I get it to do this. what does the code structurelook like I've looked all through the online help but haven't found anything. Maybe I am looking under the wrong topic -Warren R. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Calling Sub / Called Sub
Public Function B( arg ) as Boolean
if arg rnd() then B = True else B = False end if End Function in A Public Sub A() Dim bRes as Boolean bRes = b(arg) End Sub "WarrenR" wrote in message ... Scenario... I have two Subs: sub A and sub B. sub A calls sub B where sub B has functionality to determine a true or false. I want to pass a value (in this case a true or false back to the calling sub (sub A). How do I get it to do this. what does the code structurelook like? I've looked all through the online help but haven't found anything. Maybe I am looking under the wrong topic. -Warren R. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Calling Sub / Called Sub
Hi Warren
one way: Convert sub B to a function. e.g. Sub a() dim b as boolean b = func_a() msgbox b end sub Function func_a() as boolean 'some code func_a = False end function -- Regards Frank Kabel Frankfurt, Germany WarrenR wrote: Scenario... I have two Subs: sub A and sub B. sub A calls sub B where sub B has functionality to determine a true or false. I want to pass a value (in this case a true or false back to the calling sub (sub A). How do I get it to do this. what does the code structurelook like? I've looked all through the online help but haven't found anything. Maybe I am looking under the wrong topic. -Warren R. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
what is this called? : < | Excel Worksheet Functions | |||
What is this function called?? | Excel Discussion (Misc queries) | |||
Formula not being called from personal.xls | Excel Discussion (Misc queries) | |||
How can a UDF be called from a formula? | Excel Worksheet Functions | |||
Which routine called Sub()? | Excel Programming |