Results 1 to 4 of 4

Filling all elements of a two dimensional array?

Threaded View

jerseyguy1996 Filling all elements of a two... 12-03-2009, 09:55 AM
MickG Re: Filling all elements of a... 12-03-2009, 10:06 AM
Andy Pope Re: Filling all elements of a... 12-03-2009, 10:37 AM
jerseyguy1996 Re: Filling all elements of a... 12-03-2009, 11:38 AM
  1. #1
    Forum Contributor
    Join Date
    03-13-2009
    Location
    New Jersey
    MS-Off Ver
    Excel 2007
    Posts
    136

    Filling all elements of a two dimensional array?

    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?
    Last edited by jerseyguy1996; 12-03-2009 at 11:39 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1