Microsoft Office Forums vba word

Go Back   Microsoft Office Forums > >

Closed Thread
 
Thread Tools Display Modes
  #1  
Old 11-05-2018, 11:58 PM
phoenixmoto phoenixmoto is offline vba word Windows 7 64bit vba word Office 2007
Banned
vba word
 
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
  #2  
Old 11-06-2018, 01:25 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline vba word Windows 7 64bit vba word Office 2010 64bit
Moderator
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,382
Pecoflyer is a glorious beacon of lightPecoflyer is a glorious beacon of lightPecoflyer is a glorious beacon of lightPecoflyer is a glorious beacon of lightPecoflyer is a glorious beacon of lightPecoflyer is a glorious beacon of light
Default

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
__________________
Problem solved ? Let others know by clicking " Thread Tools" then " Mark thread as solved".( This can be undone if need be)
Want to thank for the help received ? Click the scales symbol in the upper right corner of a post from the person you want to thank.
  #3  
Old 11-06-2018, 01:27 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline vba word Windows 7 64bit vba word Office 2010 64bit
Moderator
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,382
Pecoflyer is a glorious beacon of lightPecoflyer is a glorious beacon of lightPecoflyer is a glorious beacon of lightPecoflyer is a glorious beacon of lightPecoflyer is a glorious beacon of lightPecoflyer is a glorious beacon of light
Default

Also post in the correct subforum in the future ( VBA Word)
__________________
Problem solved ? Let others know by clicking " Thread Tools" then " Mark thread as solved".( This can be undone if need be)
Want to thank for the help received ? Click the scales symbol in the upper right corner of a post from the person you want to thank.
  #4  
Old 11-06-2018, 01:52 PM
macropod's Avatar
macropod macropod is online now vba word Windows 7 64bit vba word Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,480
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

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
[MS MVP - Word]
Closed Thread

Tags
functions, vba, worddocument

Thread Tools
Display Modes



All times are GMT -7. The time now is 03:59 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Search Engine Optimisation provided by DragonByte SEO v2.0.37 (Lite) - vBulletin Mods & Addons Copyright © 2019 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft