Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Is vbscript a case-sensitive or case-insensitive?

1255


Is vbscript language a case-sensitive language and what does it mean?

1008


Write a vbscript procedure that converts feet to inches. Hint: there are 12 inches in a foot?

1035


What is the purpose of the err object in the vbscript language?

1099


How to capture a runtime error in vbscript?

1149


What is vbscript procedures?

1136


How you can call vbscript functions?

1079


Explain about the asc function?

1050


How can the spaces from the string be removed?

1012


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

1079


What are keywords in the vbscript language?

1027


What is loose binding? Why is it not a good practice to use it?

1098


How to assign a numeric value to a variable?

1118


How will you format a number in percetage format in vbscript?

991


How can constants be declared in the vbscript language?

987