Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all,
I have a problem about looping arrays. Consider the following program: Sub Testing2() Dim X(1 To 8) As Long Dim i As Long For i = LBound(X) To UBound(X) X(i) = Rnd * 10000 Next X will contain the random number as expected. However if I use FOR EACH loop, Sub Testing2() Dim X(1 To 8) As Long Dim Element As Variant For Each Element in X Element = Rnd * 10000 Next Then the each array element still contains 0! Why is that? Please advise. Frederick Chow Hong Kong. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
array question | Excel Worksheet Functions | |||
Array Question | Excel Worksheet Functions | |||
Array question | Excel Programming | |||
Array question | Excel Programming | |||
array question | Excel Programming |