+ Reply to Thread
Results 1 to 14 of 14

Hello, need help creating a macro with calculation, increasing rows every day

  1. #1
    Registered User
    Join Date
    09-29-2023
    Location
    USA
    MS-Off Ver
    365
    Posts
    7

    Hello, need help creating a macro with calculation, increasing rows every day

    hi, need help with this file that I create a macro but have some problems due to the fact that every day new information is added to the file, so the number of rows keeps increasing every day.
    how can I add a formula that can calculate from the first row to the last?
    Attached Files Attached Files
    Last edited by MacExcel23; 09-29-2023 at 01:41 PM.

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,207

    Re: Hello, create macro with calculation, increasing rows every day

    So what is to be calculated?
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  3. #3
    Registered User
    Join Date
    09-29-2023
    Location
    USA
    MS-Off Ver
    365
    Posts
    7

    Re: Hello, create macro with calculation, increasing rows every day

    hi, the calculation is just subtotal of each of 6 different columns. what I having trouble is to have the calculation exactly at the end of the last row due that this files keeps updating every day therefore adding more rows.

  4. #4
    Registered User
    Join Date
    09-29-2023
    Location
    USA
    MS-Off Ver
    365
    Posts
    7

    Re: Hello, create macro with calculation, increasing rows every day

    Quote Originally Posted by JohnTopley View Post
    So what is to be calculated?
    hi, the calculation is just subtotal of each of 6 different columns. what I having trouble is to have the calculation exactly at the end of the last row due that this files keeps updating every day therefore adding more rows.

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,207

    Re: Hello, create macro with calculation, increasing rows every day

    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: Hello, need help creating a macro with calculation, increasing rows every day


    Quote Originally Posted by MacExcel23 View Post
    how can I add a formula that can calculate from the first row to the last?
    Hi,

    just using Sub Total Excel feature, thus without any VBA procedure …

  7. #7
    Registered User
    Join Date
    09-29-2023
    Location
    USA
    MS-Off Ver
    365
    Posts
    7

    Re: Hello, need help creating a macro with calculation, increasing rows every day

    Quote Originally Posted by Marc L View Post

    Hi,

    just using Sub Total Excel feature, thus without any VBA procedure …
    Thanks, but it wont work as my file gets updated every day so I will always find more rows added.

  8. #8
    Registered User
    Join Date
    09-29-2023
    Location
    USA
    MS-Off Ver
    365
    Posts
    7

    Re: Hello, create macro with calculation, increasing rows every day

    Quote Originally Posted by JohnTopley View Post
    Please Login or Register  to view this content.
    thanks a lot, I will give it a try in my macro

  9. #9
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: Hello, need help creating a macro with calculation, increasing rows every day


    Quote Originally Posted by MacExcel23 View Post
    Thanks, but it wont work as my file gets updated every day so I will always find more rows added.
    Wrong ! As it's a well designed & well known Excel feature …

  10. #10
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Hello, need help creating a macro with calculation, increasing rows every day

    Worksheet evet is used. The sums for E and F column is available in N2 and O2 cells.
    addition of rows will be taken care of by worksheet event.
    Code:
    Please Login or Register  to view this content.
    How to use workheet event the code
    Right click on Sheet tab --> view code
    Visual Basic (VB) window opens.
    Paste the code
    Close the VB window.
    Save the file as .xlsm
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  11. #11
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: Hello, need help creating a macro with calculation, increasing rows every day

    Or simply so (See attached)
    Attached Files Attached Files
    Experience trumps academics every day of the week and twice on Sunday.

  12. #12
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: Hello, need help creating a macro with calculation, increasing rows every day

    Further to attachment in Post #11.
    If you want the formulas in E2 and F2 to be dynamic, you could change them to
    In E2: =SUM(OFFSET($E$3, 0, 0, COUNTA($E:$E), 1))
    In F2: =SUM(OFFSET($F$3, 0, 0, COUNTA($F:$F), 1))

    Put your cursor in A3 and click on "Freeze Panes" and scroll as much as you like. The totals will always be visible.

  13. #13
    Registered User
    Join Date
    09-29-2023
    Location
    USA
    MS-Off Ver
    365
    Posts
    7

    Re: Hello, need help creating a macro with calculation, increasing rows every day

    thanks a lot

  14. #14
    Registered User
    Join Date
    09-29-2023
    Location
    USA
    MS-Off Ver
    365
    Posts
    7

    Re: Hello, need help creating a macro with calculation, increasing rows every day

    Quote Originally Posted by kvsrinivasamurthy View Post
    Worksheet evet is used. The sums for E and F column is available in N2 and O2 cells.
    addition of rows will be taken care of by worksheet event.
    Code:
    Please Login or Register  to view this content.
    How to use workheet event the code
    Right click on Sheet tab --> view code
    Visual Basic (VB) window opens.
    Paste the code
    Close the VB window.
    Save the file as .xlsm
    thanks so much for your help

+ 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. Increasing a number when create a new sheet
    By jsinan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-30-2018, 09:27 AM
  2. [SOLVED] Macro for naming mutiple cells with increasing value every 510 rows?
    By jo_stephenson in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-16-2012, 10:30 AM
  3. [SOLVED] Formula with increasing value ranges - plumbing code calculation
    By cellophane in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-25-2012, 04:17 PM
  4. [SOLVED] Need a macro to create a special percentage calculation
    By theletterh in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-16-2012, 12:54 PM
  5. Replies: 0
    Last Post: 08-30-2010, 10:30 PM
  6. Macro to print rows that keep increasing?
    By debbiesh in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-31-2009, 03:18 PM
  7. create macro with do calculation using formula
    By cyrene in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-03-2005, 09:44 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