+ Reply to Thread
Results 1 to 8 of 8

Automate formulated rows based on user input

  1. #1
    Registered User
    Join Date
    01-14-2011
    Location
    Idaho
    MS-Off Ver
    Excel 2007
    Posts
    4

    Automate formulated rows based on user input

    I have seen many similar questions and a lot of great answers, so I am hoping someone can help me. I have no knowledge of macros...so please be kind.

    I have a "cash burn" schedule that I have built and it works great, but I would like to automate it even more.

    I would like to have it add/subtract rows with calculated formulas based on user input. At the top of the sheet, I input the "Total Cost" in F2 and the "Duration" in K2. Based on the Duration(K2) I would like the numbered rows beginning at Row 4 to expand and/or contract keeping the formulas and row numbers (+1). The formulas distribute cash over a given time period.

    Here is the file:
    Construction Spend.xls

    Thanks in advance.

  2. #2
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Automate formulated rows based on user input

    OK, try this,

    Click the calculate button and enter the amount of rows you want to calculate, eneter the amount, enter the duration in the prompt boxes.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by JapanDave; 01-31-2012 at 11:36 PM.
    Be fore warned, I regularly post drunk. So don't take offence (too much) to what I say.
    I am the real 'Napster'
    The Grid. A digital frontier. I tried to picture clusters of information as they moved through the computer. What did they look like? Ships? motorcycles? Were the circuits like freeways? I kept dreaming of a world I thought I'd never see. And then, one day...

    If you receive help please give thanks. Click the * in the bottom left hand corner.

    snb's VBA Help Files

  3. #3
    Registered User
    Join Date
    01-14-2011
    Location
    Idaho
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Automate formulated rows based on user input

    @JapanDave,

    Thanks, it works. It did drop the currency formatting when I entered a duration of 36 on one of the expanded cells. Is there a way to have the calculate button default to the current value? For instance, if you want to run another scenario with a different dollar amount but keep the same duration or vice versa.

  4. #4
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Automate formulated rows based on user input

    See if this does what you are after?
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    01-14-2011
    Location
    Idaho
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Automate formulated rows based on user input

    Not exactly. The calculate field comes up blank, and if you don't input anything, it zeros out the amounts in the corresponding cells or comes up with a run time error. If all else fails the first version works great except in office for Mac 2008...evidently VBA is not supported in that version.

    If you have time and can get it working, it would be great, if not I am better off than I was.

  6. #6
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Automate formulated rows based on user input

    I am not sure I follow. What do you mean by the calculate field? Are talking about the input box where you enter a value when prompted? What is sheet3 for? I am sure there is a solution, so don't worry.

  7. #7
    Registered User
    Join Date
    01-14-2011
    Location
    Idaho
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Automate formulated rows based on user input

    Sheet 3 is a hangover, you can disregard. My apologies. To clarify, I was referring to the input field when you click on the calculate button. It would be great if this had a default value that was the last value entered so if you only wanted to change the duration and keep the cost as it is, you wouldn't have to enter the cost again. You could just click 'OK' when the cost input came up and the current value would remain.

    Does this make sense?

  8. #8
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Automate formulated rows based on user input

    OK, Give this a whirl.
    Attached Files Attached Files

  9. #9
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Automate formulated rows based on user input

    define type as static if you want to preserve the value of the last user inputs
    Attached Files Attached Files

  10. #10
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Automate formulated rows based on user input

    JieJenn, it does not have to have variable defined as a static variable. If the value was being cleared, then yes I would say use one, but in this case the value remains in the cell so referring to the cell achieves the same result. Just my thoughts on the example, I am open to other opinions however.
    Last edited by JapanDave; 02-02-2012 at 12:14 AM.

+ 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