+ Reply to Thread
Results 1 to 4 of 4

Running a calculation X times with changing inputs and placing of output into cells

  1. #1
    Registered User
    Join Date
    12-17-2012
    Location
    South Carolina
    MS-Off Ver
    Excel 2010
    Posts
    12

    Running a calculation X times with changing inputs and placing of output into cells

    I have a cell in sheet1 (say, B2) in which I can key a date. Once I change that date, cell C10 updates (after I hit F9 to recalculate) with a new number based on the new date.

    I have a list of dates on another sheet, from 1/1/2009 to 12/31/2013, all in column B. I want to produce VBA code that will run through each day, 1/1/2009 to 12/31/2009, in sheet1 cell B2 and take the output in C10 and place it next to each day in column B until it reaches the end (12/31/2013). I know this is possible but for some reason am having trouble coming up with the right looping mechanism.

    You can imagine if I had to manually key in each day to get the desired output how tedious that would be. Thank you.

  2. #2
    Forum Contributor
    Join Date
    05-29-2013
    Location
    MD
    MS-Off Ver
    Excel 365
    Posts
    148

    Re: Running a calculation X times with changing inputs and placing of output into cells

    Try this:

    It assumes the range of dates starts in Sheet2!A1. It takes the date, enters it in Sheet1!B1, recalculates, takes the output from Sheet1!C10 and puts it in column B.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    12-17-2012
    Location
    South Carolina
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Running a calculation X times with changing inputs and placing of output into cells

    This worked! Thanks. The line

    Please Login or Register  to view this content.
    did not work for some reason, but i simply changed it to

    Please Login or Register  to view this content.
    The recalculation wasn't working right so I just got rid of that and made it automatically calculate and it worked like charm. Thanks again.

  4. #4
    Forum Contributor
    Join Date
    05-29-2013
    Location
    MD
    MS-Off Ver
    Excel 365
    Posts
    148

    Re: Running a calculation X times with changing inputs and placing of output into cells

    Don't forget to click the star at the bottom left of the post that solved it, and mark the thread as solved!

+ 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. Output based on multiple inputs (Need Advice)
    By ddubbs in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-07-2013, 11:31 AM
  2. [SOLVED] IF function- two inputs, one output
    By andrew.mcdonald in forum Excel General
    Replies: 1
    Last Post: 04-05-2012, 11:59 AM
  3. Hold Output constant and flex 2 inputs
    By jwintim in forum Excel General
    Replies: 1
    Last Post: 04-20-2011, 01:02 PM
  4. Replies: 1
    Last Post: 09-23-2009, 05:27 AM
  5. Multiple inputs one output
    By Chris W via OfficeKB.com in forum Excel General
    Replies: 1
    Last Post: 08-25-2005, 02:05 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