+ Reply to Thread
Results 1 to 6 of 6

Automate 'fill formulas in tables to create calculated columns'

  1. #1
    Registered User
    Join Date
    06-14-2017
    Location
    Singapore
    MS-Off Ver
    2010 2013 2016
    Posts
    11

    Automate 'fill formulas in tables to create calculated columns'

    I need to automate the task of 'Overwrite all cells in this column with this formula' using a macro, on multiple files. However, this instruction does not get recorded with the macro recorder when I do it the manual way: typing the formula, clicking the drop down and selecting the 'Overwrite all cells...'.

    Basically I want to achieve having formulas in each particular column auto-filling when I add rows to a table.

    Anyone knows any vba instruction for me to perform this?

    Thanks!
    Last edited by supremesabre; 07-13-2017 at 01:29 PM.

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Automate 'fill formulas in tables to create calculated columns'

    Here's a snippet that you may be able to adapt:

    Please Login or Register  to view this content.
    Or

    Please Login or Register  to view this content.
    Where Cells(r, c).Resize(1, x) is the row with the Formulas
    Last edited by xladept; 07-13-2017 at 02:23 PM.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    06-14-2017
    Location
    Singapore
    MS-Off Ver
    2010 2013 2016
    Posts
    11

    Lightbulb Re: Automate 'fill formulas in tables to create calculated columns'

    Thanks xladept... But I'm not sure how to implement the snippet =/

    I uploaded a sample file showing this autofill problem. The table on the left does not autofill formulas when a row is added under 'barcode'. The table on the right works as I want. I need to make the left table autofill formulas...

    Would greatly appreciate if you could point me in the right direction.

    Thanks
    Attached Files Attached Files

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Automate 'fill formulas in tables to create calculated columns'

    For your sample:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-14-2017
    Location
    Singapore
    MS-Off Ver
    2010 2013 2016
    Posts
    11

    Re: Automate 'fill formulas in tables to create calculated columns'

    Works great! Thank you! Have added your reputation.

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Automate 'fill formulas in tables to create calculated columns'

    You're welcome and thanks for the rep!

+ 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. Automate hiding columns, adding columns, inserting formulas, and filtering
    By hpatel517 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-27-2016, 11:17 AM
  2. [SOLVED] macro to fill table looping thru columns and rows Cell Value is calculated
    By moshro1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-04-2014, 03:34 PM
  3. Need to auto sort tables or adapt formulas to fill cells based on values.
    By dropanddrive03 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-20-2013, 12:21 PM
  4. how can i automate mathematic formulas spreading across columns?
    By robertomano24 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-22-2012, 01:36 AM
  5. [SOLVED] pivot table formulas for calculated field or calculated item
    By Vicky in forum Excel General
    Replies: 3
    Last Post: 06-06-2006, 12:10 AM
  6. [SOLVED] Using Formulas in Calculated Fields in Pivot Tables
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-14-2005, 03:35 PM

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