How can we return a value from User Defined Function ?
For Eg. we have 2 functions. In Fun1 i am getting 2 values
(a,b) and i am addding those 2 and storing in to another var
(c). Now i want to pass that var(c) to another function
(fun2). What will be the script?

Answer Posted / chivukula.kumar

'Try this Code in Only MS-Excel

'After opened should be press Alt+F11
'select and double click the ThisWoorkbook in VBA Project
leftside of application
' paste this code in that

Private Sub Workbook_Open()
Call add(1000, 20000, c)
Call subb(c, 20000)
End Sub

'Creation of Fun1 and Fun2(add and subb)

Function add(a, b, c)
a = a + b
c = a
MsgBox c
End Function

Function subb(c, d)
sb = c - d
MsgBox sb
End Function

Is This Answer Correct ?    10 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How should i Create Email invite with server-side Coding?

1599


What purpose does ‘on error resume next’ serves?

545


how to answer "TELL ME ABOUT UR SELF" as exp.person. whr to start and whr to stop. can anyone tel me

1335


How can constants be declared in the vbscript language?

547


What is the scope of a constant declared using public?

551






can anyone tell me the procedure of interview held in applabs

1746


Mention how you can call vbscript functions?

577


Both Static and dynamic arrays are handled by VB script. Is it true?

605


What are class events?

578


Mention how to access array data?

509


PLz send me the VB scripts which is having more examples my email id : hareen_11@yahoo.com

1660


Mention the environments where vbscript could be run?

651


write any ttest cases using check points and parameterization

1814


How to open a file. What is the perpose of true and false mode there?

603


How to throw an error in vbscript?

601