+ Reply to Thread
Results 1 to 2 of 2

Selecting a single column of a multi-dimensional array

  1. #1
    Registered User
    Join Date
    12-27-2007
    Posts
    5

    Smile Selecting a single column of a multi-dimensional array

    Hi,

    Is there a way to tell VBA to work with all the rows in a single column of a multi-dimensional array?

    My problem is I have a multi-dimensional array that contains data that I want to do some calculations on. Let's say the array has 10 rows and 5 columns. If I wanted to take the average and standard deviation of each column individually, how would I do that?

    What I had in mind was something like this...

    For i = 1 to no_columns
    avg_temp = application.worksheetfunction.average(array_values( ? , i)
    stdev_temp = application.worksheetfunction.stdev(array_values( ? , i)
    next i

    I don't know how to tell VBA that I want to take into account all the rows from column i of the array. Any help would be greatly appreciated.

    Thanks.

    -HSM

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    1. Please edit your post to add code tags.

    2. The Index function (available to VBA) with one value set to zero will return a row or column of an array.
    Entia non sunt multiplicanda sine necessitate

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Converting a matrix into a single column
    By dthan in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 11-21-2008, 05:56 PM
  2. Locating and selecting a column with VB Script
    By bigtonyicu in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-24-2008, 02:17 PM
  3. Multi column conditional formatting
    By zandinga in forum Excel General
    Replies: 4
    Last Post: 02-04-2008, 11:00 AM
  4. multi column search_multi column return
    By ti103r in forum Excel General
    Replies: 3
    Last Post: 12-18-2006, 05:58 PM
  5. Selecting a cell in a certain column
    By johncassell in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-08-2006, 10:04 AM

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