Thread: vba word
View Single Post
 
Old 11-05-2018, 11:58 PM
phoenixmoto phoenixmoto is offline Windows 7 64bit Office 2007
Banned
 
Join Date: Jul 2018
Posts: 11
phoenixmoto is on a distinguished road
Question vba word

Here in this code in word as i dont know how to use functions(ex:application.worksheetfunction in excel) i tried to create my own function but it is not working may be function creation is incorrect. so please answer me that is it possible to use something like application.worksheetfunction in word or shouldd we create our own function if so how?

If wow.Value = True Then
Select Case comb
Case "addition"
Call amrit(a, b, c)
Case "subtraction"
Call sam(a, b, c)
End Select
End If
hide
End SubSub sum(a As Variant, b As Variant, c As Variant)
ThisDocument.TextBox10.Value = amrit(a, b, c)
End Sub
Sub minus(a As Variant, b As Variant, c As Variant)
ThisDocument.TextBox10.Value = sam(a, b, c)
End Sub
End Sub
Public Function amrit(a As Variant, b As Variant, c As Variant) As Variant
amrit = a + b + c
End Function
Public Function sam(a As Variant, b As Variant, c As Variant) As Variant
sam = a - b - c
End Function