Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default 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
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
what is this called? : < Jake Excel Worksheet Functions 1 November 28th 06 11:01 AM
What is this function called?? jPaulB Excel Discussion (Misc queries) 3 August 4th 06 08:33 PM
Formula not being called from personal.xls [email protected] Excel Discussion (Misc queries) 5 September 22nd 05 01:15 PM
How can a UDF be called from a formula? GuyH Excel Worksheet Functions 0 November 17th 04 03:37 PM
Which routine called Sub()? mikeang[_4_] Excel Programming 1 January 16th 04 04:38 PM


All times are GMT +1. The time now is 07:22 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"