• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Macro to Automate Scenarios

bkanne

Member
Hi,

I am in need of a macro that that can change a cell to each of the values in the rows below it and calculate the spreadsheet at each point in between.

In the sample data, I need cell D9 to change from 1 through 50, and at each number in between, calculate before moving onto the next row.

Thank you!
 

Attachments

  • Sample Data_v1.xlsm
    14.8 KB · Views: 4
Fantastic!! Thank you so much.

Any way to reset the count back to 1 afterwards? Also, will this run into issues if there are other cells in the 4th column above it?
 
Now it 'reset's back to 1.
You can ADD 'any number of rows' below row nine (not above).
... only take care those 'formula ranges'.
 

Attachments

  • Sample Data_v1.xlsm
    24 KB · Views: 3
Super, super helpful. Can't thank you enough.

My final question- when this runs through the scenarios, it also runs one additional beyond the max (i.e., if there are 10, it runs through 11). Is there any way to stop it at the maximum instead of running the last one?

If it's a lot of trouble then probably not worth worrying about (I can just make the last scenario equal to the first so it doesn't break the model by running empty cells).
 
Is Your 11th Cell really empty?
Empty means really empty = nothing = not even space!
I tested with data rows from 10 to 19.
It runs from 1 to 10 and back to 1.
>> If still challenge then send Your file here.
 
Back
Top