+ Reply to Thread
Results 1 to 5 of 5

Excel Formula in word VBA

  1. #1
    Forum Contributor
    Join Date
    02-20-2014
    Location
    Ireland
    MS-Off Ver
    Excel 2013
    Posts
    108

    Excel Formula in word VBA

    Hi All,

    I have a word document with a table

    I am looking at 3 columns and need to work a formula and put the result in column 4

    For the sake of keeping things simple, I will call them columns ABCD (even though this is MS Word)

    I need to subtract B from A
    I need to subtract C from A
    Then I need to look at both results and place the higher number in Column D

    In excel format it looks like this
    Please Login or Register  to view this content.
    Any help greatly appreciated

    Simon

  2. #2
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,404

    Re: Excel Formula in word VBA

    You should be able to use the built in 'formula' command in Word. Click inside your table and go to the 'Table Tools > Layout' tab on the ribbon. Look at the right-hand side and you'll see a 'Formula' button (it looks similar to the symbol beside the formula bar in Excel). Click this and you'll get a dialogue box where you can type your formula - you can also choose functions from the 'Paste function' section at the bottom. ABS and MAX are both includes, so there's no reason you can't get your required formula. Although Word doesn't show them, rows and columns in Word tables are referred to the same way as Excel - columns from A to ... and rows from 1 to ... - so you can probably just use your formula directly.

    Hope that helps.
    Regards,
    Aardigspook

    I recently started a new job so am a bit busy and may not reply quickly. Sorry - it's not personal - I will reply eventually.
    If your problem is solved, please go to 'Thread Tools' above your first post and 'Mark this Thread as Solved'.
    If you use commas as your decimal separator (1,23 instead of 1.23) then please replace commas with semi-colons in your formulae.
    You don't need to give me rep if I helped, but a thank-you is nice.

  3. #3
    Forum Contributor
    Join Date
    02-20-2014
    Location
    Ireland
    MS-Off Ver
    Excel 2013
    Posts
    108

    Re: Excel Formula in word VBA

    Aardigspook

    Thanks for your quick reply

    I completely forgot about this function, this will save me a lot of time

    Rep Added

    Simon

  4. #4
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,404

    Re: Excel Formula in word VBA

    You're welcome - thanks for the feedback and the rep.

  5. #5
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Excel Formula in word VBA

    In Word, you should be able to use the same formula. Simply create a pair of field braces via Ctrl-F9 (i.e. { } ) then type your formula between them, thus:
    {=ABS(MAX((B10-A10)*100/B4,(C10-A10)*100/B4))}
    and press F9 to update.

    To see how to do a wide range of calculations in Word, check out my Microsoft Word Field Maths Tutorial, at:
    http://windowssecrets.com/forums/sho...Maths-Tutorial
    or:
    http://www.gmayor.com/downloads.htm#Third_party
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Excel Formula to separate Word in a Text
    By su2009 in forum Excel General
    Replies: 2
    Last Post: 11-30-2015, 08:01 AM
  2. Excel formula switch first and Second word but keeps 3rd and remaining word in single cell
    By iwanttoexcelinexcel in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-29-2015, 04:22 PM
  3. [SOLVED] Help With Word Based Excel Formula Using IF/OR Statement
    By mhickman in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-19-2014, 03:12 PM
  4. Want excel formula/macro to pull external text string from WORD and display in excel
    By crnadeau4 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-21-2013, 12:49 PM
  5. Excel and Word Recognition Formula
    By vagal456 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-10-2012, 05:32 PM
  6. having a word appear for an excel formula
    By malcolmxm in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-05-2008, 12:53 PM
  7. [SOLVED] Word Doc w/2 Excel Sheets - need formula to link them
    By Tab in forum Excel General
    Replies: 1
    Last Post: 03-07-2006, 07:45 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1