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
Mention how to assign a date value to a variable?
Capture the Unique label changes on google home page for I am feeling lucky button and save those label changes to Notepad Note: Using QTP
Explain the adodb.stream class?
How to find the font in qtp. Scenario:After entering the username and passwd you will be navigate into the "welcome:Username" page.Now I want to extarct font for this message.
What aspects of vbscript make it safe so that a web page using vbscript cannot destroy or corrupt information on a user's computer?
filter the array values without using filter function?
why do u choose to go for testing why cant for devoloping
how to write validation function for date in vb script
How to declare an array in vbscript?
What is the difference between for loop and while loop?
Plzzzzzzz can any one tell me which is the best institute in hyderabad for learing VBScript. plz do answer guys its urgent plzzzzzzz. thanks in advance.
How to Import data from a file (file is on the desktop) to the data table
How will you get a subset of a array in vbscript?
How are arrays declared in the vbscript language?
What is the difference between a dictionary and an array?