Results 1 to 11 of 11

Update formula when inserting/deleting coulumns

Threaded View

  1. #1
    Registered User
    Join Date
    09-04-2019
    Location
    Romania
    MS-Off Ver
    2010, 2013
    Posts
    8

    Update formula when inserting/deleting coulumns

    i've created 2 macro buttons to insert/remove columns

    i want the formula under HOURS to update to include the newly added columns
    for the minimum 3 periods the formula looks like this

    =SUM((C3-B3);(E3-D3);(G3-F3))

    if i press the button to add a period the formula doesn't update to include (I3-H3) period and so on

    after some searches i found 2 suggestions

    =SUM(INDIRECT("b4:"&ADDRESS(ROW();COLUMN()-1)))
    and
    =SUM((INDEX(5:5;2):INDEX(5:5;COLUMN()-1)))

    but this only sums everything up to COLUMN()-1 and i can't figure out how can i modify them to suit my needs.
    i want the period from "from" to "to" to be calculated for each interval and summed so i would get a total of hours worked per day




    as a side request. for my VBA code after the creation of 2 columns is there a simpler way to fill them with "FROM" and "TO" than i come up with? (which is basic text inserting but get the job done)

     Range("2:2").Find("").Select
    ActiveCell.Formula = "FROM"
    Range("2:2").Find("").Select
    ActiveCell.Formula = "TO"

    thanks
    Attached Files Attached Files
    Last edited by Konta; 03-20-2020 at 10:26 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Need to update formula after inserting rows
    By 4lowie in forum Excel General
    Replies: 2
    Last Post: 05-04-2014, 03:17 AM
  2. update a formula after inserting a row using a macro
    By smash96 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-05-2014, 10:52 AM
  3. Inserting and Deleting rows while maintaining formula consistency
    By ChaeDoc in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-16-2013, 05:42 AM
  4. Inserting Rows, formula update
    By SalamanderSam14 in forum Excel General
    Replies: 3
    Last Post: 01-05-2012, 12:45 PM
  5. Update data by inserting/deleting new row
    By ioncila in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-28-2009, 06:04 PM
  6. Auto Update upon shifting, inserting or deleting
    By Tracy B in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-06-2005, 04:06 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