New Excel Forum

This forum has been moved to TeachExcel.com

Ask all future questions in the New Excel Forum.

ExcelKey

Macro to calculate multiple scenarios at once and display the results

Macros, VBA, Excel Automation, etc.

Macro to calculate multiple scenarios at once and display the results

Postby Evolution_GT » Mon Oct 05, 2015 2:30 pm

Hello all,

I'm new to the forum and I was hoping I could get some assistance writing this particular macro. I have three sheets, first of which let's refer to as "sheet1", second will be called "List", and third will be called "Calculator".

The "calculator" sheet has several fields which can be manipulated to change the end result, using several formulas and references to other data tables that make it necessary to use scenarios.

"sheet1" contains raw data inputs in cells I3:I5 and K3:K5, which, depending on the type of calculation (will explain later), either I3:I5 OR K3:K5 will be used to populate cells G15:G17 in the "Calculator" sheet, for a given scenario. Let's call the first type "PV1" (uses I3:I5 from "sheet1" to populate G15:G17 in "calculator" sheet), and the second type "PV2" (uses K3:K5 from "sheet1" to populate G15:G17 in "calculator" sheet). The scenario type is indicated as a column heading in the "List" sheet, PV1 and PV2 are in cells "I6" and "J6", respectively. All scenarios require that both scenario types be calculated.

The "List" sheet contains the rest of the raw inputs for each scenario. The headings for these raw data inputs are on row 6, and extend from columns C-F, and column H. Based on the result from the "calculator" sheet (cell S22), this result will feed back into the "List" sheet. The result for scenario type "PV1" will go into column "I", and the result for scenario type "PV2" will go into column "J". As for the other raw data inputs for each scenario, for each respective column stated, they will feed into the following cells in the "calculator" sheet (first scenario begins in row 7):

Column C -> C8
Column D -> E8
Column E -> G8
Column F -> G10
Column H -> G12

Again, the first scenario row begins on row 7, and can potentially go on for at least hundreds of rows.

Also, in sheet "List", there is a trigger in column B (let's call the heading "Trigger"): if the cell in column B states "A", then the macro should ignore this scenario. If the cell in column B states "P", then the macro should calculate this scenario.

This macro I intend to attach to a button.

Any help that can be provided for this would be very, very much appreciated.

Thank you in advance for your time.
  • 0

Evolution_GT
Rookie
 
Posts: 2
Joined: Oct 5, 2015
Reputation: 0
Excel Version: 2010

Re: Macro to calculate multiple scenarios at once and display the results

Postby pecoflyer » Tue Oct 06, 2015 4:34 am

Hi and welcome
please post a sample sheet ( no pics please) - Thx
  • 0

A relevant topic title helps get faster and more answers
pecoflyer
Moderator
 
Posts: 1274
Joined: Jan 24, 2012
Location: Belgium
Reputation: 39
Excel Version: 2003/2007/2010

Re: Macro to calculate multiple scenarios at once and display the results

Postby Evolution_GT » Tue Oct 06, 2015 8:24 am

pecoflyer wrote:Hi and welcome
please post a sample sheet ( no pics please) - Thx


Thank you - please see link below and let me know if you have any further questions. Please note - the formulas in sheet "List", columns I and J, do not relate to this macro and can be ignored.

Thank you very much again for your time.

https://drive.google.com/file/d/0B2u2BLgJoahtX0V3bnlWLWx0TkE/view?usp=sharing
  • 0

Evolution_GT
Rookie
 
Posts: 2
Joined: Oct 5, 2015
Reputation: 0
Excel Version: 2010

Re: Macro to calculate multiple scenarios at once and display the results

Postby NoSparks » Wed Oct 07, 2015 9:56 am

Think you forgot to mention this.
  • 0

NoSparks
Excel Hobbyist
 
Posts: 637
Joined: May 28, 2014
Reputation: 103
Excel Version: 2010


Return to Macros and VBA Questions

Who is online

Users browsing this forum: No registered users and 225 guests