Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Sat, 20 Sep 2008 17:43:44 -0400, "Rick Rothstein"
wrote: A For loop can only use a number for the count. That is not entirely true... you can use a For Each loop to iterate a collection or an array without referring to any numerical values. For example, here is a rewrite of your code to demonstrate this... <Code Dim Word As Variant For Each Word In Array("Red", "Green", "Blue", "Orange") Debug.Print Word Next </Code This solution is interesting to me as well and may get used in the future, but the other solution posted gives me a better opportunity to put a comment after each string value so I can better document what is being done. Thanks for the idea. John Keith |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Loop thru variables | Excel Programming | |||
evaluate and variables and loop... | Excel Programming | |||
Non Static Variables in a For...Next Loop | Excel Programming | |||
Is it possible to create variables in a loop.. | Excel Programming | |||
Write variables from a loop, once only | Excel Programming |