#1
|
|||
|
|||
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 |
#2
|
||||
|
||||
You should know by now that code MUST be wrapped with code tags to make it easier to read and copy.
Edit your first post,select your code and click the #button Thank you
__________________
Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post |
#3
|
||||
|
||||
Also post in the correct subforum in the future ( VBA Word)
__________________
Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post |
#4
|
||||
|
||||
Cross-posted at: http://www.vbaexpress.com/forum/show...?64006-vba-hos
For cross-posting etiquette, please read: http://www.excelguru.ca/content.php?184 As advised at VBA Express, where you also have a penchant for posting in the wrong forum, this is not a free coding forum. Thread closed.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Tags |
functions, vba, worddocument |
Thread Tools | |
Display Modes | |
|