I know that I could write something like:
Dim i(1 to 10, 1 to 10) As single
Dim k as integer
Dim l as Integer
For k = 1 to 10
For l = 1 to 10
i(k,l) = something
next
next
What I am wondering is if there is a way to fill every element with a "For Each" statement. Something like:
For Each Element in Array
Element = Something
Next
I tried it with this:
Sub Test1()
Dim A(1 To 30, 1 To 10000)
Dim i As Element
For Each i In A
i = Application.WorksheetFunction.NormInv(Rnd(), Mu, Stdev)
Next
but apparently there is no variable type called "Element".
I am just looking for a faster way to fill up an array with numbers. Any ideas?
Bookmarks