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
What is sql loader? Explain the files used by sql loader to load file?
what is the features of visual basic?
What is the difference between VBScript and JavaScript?
How to Enter Values on the Command promt using VB script
What is the use of the ‘open’ method to work with the database in the vbscript language and what connection string is passed in the same and what is its usage?
How can constants be declared in the vbscript language?
wht must be the interview question on corinthian information technology solutions incorporated.
What is dictionary object in vbscript? Explain?
What is the difference between vb debugger and the script debugger?
How are arrays declared in the vbscript language?
Which in-built function is used to format the number in the vbscript language?
write a program to display configuration of a local system with the help of vb script.
What are the special sub-types in vbscript?
Explain about .wsf files?
What is the difference between a dictionary and an array?