+ Reply to Thread
Results 1 to 2 of 2

Macro to calculate number sequence into rows and then copy formulas down to meet

  1. #1
    Registered User
    Join Date
    02-16-2012
    Location
    Belfast
    MS-Off Ver
    Excel 2007
    Posts
    13

    Macro to calculate number sequence into rows and then copy formulas down to meet

    Using Excel 2007, I have a spreadsheet (attached), which has the following

    Have a maximum number (B1) and minimum number (B2). E.g. 0 and 10, but the maximum number may change. Using an increment (B3) of 0.5, I want to do the following:
    1. Generate a sequence e.g. 0,0.5,1....10 and copy in to cell A6 downwards, maximum row possible will be 200 (to take into consideration change in maximum number, and increment).
    2. Copy the formulas in B6 and C6 down to meet the row with the final number, in this case 10 (Cell A17) in row 17.
    3. Add the following formula =average(B6row with final value eg. B17)), to the cell immediately below the row with the final value, in this case B18 (highlighted yellow). This formula only averages cells in column B6:B17.
    4. Cell F2 then equals this average cell in this case =B18. (Highlighted red). This will be a summary average, for the user, to save having to scroll down to see the average cell, which is B18.
    5. I then want the graph to update to take into account this new information, uses A6:A17 as x-axis and B6:B17 as y-axis.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: Macro to calculate number sequence into rows and then copy formulas down to meet

    Hello there,

    Attached is your original worksheet updated to include formulas and a code that executes when the worksheet it changed. I have inserted comments in the code to help you understand what it is doing. Let me know if this works for you and if you have any questions!

    Remember to enable macros!

    Thanks!

    RVASQUEZ
    Attached Files Attached Files

+ 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