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
How should i Create Email invite with server-side Coding?
What purpose does ‘on error resume next’ serves?
how to answer "TELL ME ABOUT UR SELF" as exp.person. whr to start and whr to stop. can anyone tel me
How can constants be declared in the vbscript language?
What is the scope of a constant declared using public?
can anyone tell me the procedure of interview held in applabs
Mention how you can call vbscript functions?
Both Static and dynamic arrays are handled by VB script. Is it true?
What are class events?
Mention how to access array data?
PLz send me the VB scripts which is having more examples my email id : hareen_11@yahoo.com
Mention the environments where vbscript could be run?
write any ttest cases using check points and parameterization
How to open a file. What is the perpose of true and false mode there?
How to throw an error in vbscript?