+ Reply to Thread
Results 1 to 7 of 7

Automatic updattion of a formula

Hybrid View

  1. #1
    Registered User
    Join Date
    07-10-2009
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    5

    Automatic updattion of a formula

    Hi All,


    I have data in P21 to P44
    I sum it using a formula "=SUBTOTAL(9, P21:P44)" in row 45.

    I inserted 10 rows using a macro and pasted some data in these newly inserted rows by opening another workbook using the macro.

    My formula is not changing. It remains same.
    I want this formula as "=SUBTOTAL(9, P21:P54)

    How can I achieve this?

    Thanks in advance.

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,446

    Re: Automatic updattion of a formula

    Have you got calculation turned off in the macro or in options?
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Registered User
    Join Date
    07-10-2009
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Automatic updattion of a formula

    Hey sweep,

    Thanks for the quick response.

    No. I haven't turned it off both in options as well as in macro.

    From another forum I gt following help:

    Define a name as "TotRange" with Refers to value as below

    =OFFSET('Capex Details'!$P$21,0,0,COUNTA('Capex Details'!$P24:$P3),1)
    Then enter formula as "=SUBTOTAL(9,TotRange)"

    This works properly, but results in circular reference if I put this formula just below the last row i.e. in P45

    Just sharing this so that this might give some clue.

    Thanks once again.

    nik

  4. #4
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,446

    Re: Automatic updattion of a formula

    Something's not right for sure! Can you post your worksheet?

  5. #5
    Registered User
    Join Date
    07-10-2009
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Automatic updattion of a formula

    Hey sweep,

    Here I am attaching two excel files.

    Both are identical. Both are protected with one common password as "password"

    One file is master file (Budget_master.xls)and another is data file (Budget_Projection.xls).

    I am trying to copy data from data file to master file with a macro "File_Copy"

    I have prvided a command button called "Merge Files"

    Just open Budget_Master.xls
    Click on Merge Files
    Open Budget_Projection.xls file after you are prompted for
    Then just keep watching.
    Lastly check the totals in Budget_Master.xls --- these are not updated.

    Thanks.


    This macro works fine. But does not change the totals after merging.
    Last edited by nik99; 07-22-2009 at 01:11 PM.

  6. #6
    Registered User
    Join Date
    07-10-2009
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Automatic updattion of a formula

    Hey Sweep,

    This problem is solved.

    Defined a name "Arange"with range as below in refers to:

    =Sheet1!$P$21:P44

    Note:- in the range last cell address is without any $ sign.

    Then in row 45 where the total is required.. entered the following formula..

    =SUBTOTAL(9, Arange)

    Similarly, separate names defined for each column such as Brange, Crange.... Zrange etc.

    That's all. This solved my problem. After adding some more rows & pasting the data in those newly inserted rows, the code in "Arange" changed automatically as =Sheet1!$P$21:P54

    I had posted this problem on Mr Excel forum. There I got some clues. I developed it further. Thanks to all those supported me in Mr. Excel forum and this forum too.

    Thanks for your efforts.

    nik

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Automatic updattion of a formula

    I had posted this problem on Mr Excel forum.
    Please read our forum rules about cross-posting before posting again.
    Entia non sunt multiplicanda sine necessitate

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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