Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel 2007 VBA - looping through scenarios not possible?
Hi,
I have a number of scenarios that I need to perform some calculations on. I am trying to keep the code short by having a for - next loop running through all the scenarios. I am not having much luck getting that to work, though. Shouldn't the following work? For intLooping = 1 To 20 Scenarios(intLooping).Show Next The following, on the other hand, does work (but doesn't do any good). For intScenNr = 1 To 20 arrScenarios(intScenNr - 1) = Scenarios(intScenNr).Name Next MsgBox Scenarios(1).Name & " - to - " & Scenarios(6).Name MsgBox arrScenarios(0) & " - to - " & arrScenarios(5) Thanks for any ideas! cheers, wim |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel 2007 VBA - looping through scenarios not possible? - nevermind
sorry about that one.
It helps to turn off protection on the sheet first. cheers, wim "Wim R.M. Dekeyser" <firstAtlastDotorg wrote in message ... Hi, I have a number of scenarios that I need to perform some calculations on. I am trying to keep the code short by having a for - next loop running through all the scenarios. I am not having much luck getting that to work, though. Shouldn't the following work? For intLooping = 1 To 20 Scenarios(intLooping).Show Next The following, on the other hand, does work (but doesn't do any good). For intScenNr = 1 To 20 arrScenarios(intScenNr - 1) = Scenarios(intScenNr).Name Next MsgBox Scenarios(1).Name & " - to - " & Scenarios(6).Name MsgBox arrScenarios(0) & " - to - " & arrScenarios(5) Thanks for any ideas! cheers, wim |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
excel crashing when I use scenarios tool | Excel Discussion (Misc queries) | |||
Comparing scenarios/forecasts in Excel | Excel Worksheet Functions | |||
Excel Scenarios | Excel Programming | |||
Multiple vendors and scenarios - Excel | Excel Worksheet Functions | |||
Excel Scenario Manager should let me re-order scenarios (in the s. | Excel Discussion (Misc queries) |