Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
excel crashing when I use scenarios tool [email protected] Excel Discussion (Misc queries) 0 May 18th 07 09:38 PM
Comparing scenarios/forecasts in Excel Nemo Dat Excel Worksheet Functions 0 January 4th 06 07:51 AM
Excel Scenarios Bryan Excel Programming 1 May 2nd 05 08:11 PM
Multiple vendors and scenarios - Excel Vincent Kelly via OfficeKB.com Excel Worksheet Functions 1 March 2nd 05 04:47 AM
Excel Scenario Manager should let me re-order scenarios (in the s. Jayson Beatty Excel Discussion (Misc queries) 0 December 2nd 04 08:25 PM


All times are GMT +1. The time now is 09:10 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"