+ Reply to Thread
Results 1 to 4 of 4

Cycling through 1 dimension of an array

  1. #1
    Forum Contributor
    Join Date
    02-23-2006
    Location
    Near London, England
    MS-Off Ver
    Office 2003
    Posts
    770

    Question Cycling through 1 dimension of an array

    Ok, this I am fairly sure can be done, in fact I was sure I had done it before.

    Using index, I know passing 0 as the row or column num returns the entire row or column.

    So I have an array containing worksheets, and an associated column number:
    Please Login or Register  to view this content.
    So now I think I should have a nice array with a list of worksheet 'objects' in the first column, and column numbers in the second column.

    So now I want to use a for...each... loop to step through the worksheets, but I don't seem to be able to.

    I have this following the code snippet above:
    Please Login or Register  to view this content.
    Trying to return 'every row of the first column' with rownum=0, and columnnum=1.
    However I get the error;
    Method 'Index' of object 'WorkSheetFunction' failed
    I've then even tried just access the 'column numbers' that I placed in the second column of the array, but I get the same error

    Ideas please...
    Last edited by Phil_V; 08-17-2009 at 09:43 AM.
    If you find the response helpful please click the scales in the blue bar above and rate it
    If you don't like the response, don't bother with the scales, they are not for you

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Cycling through 1 dimension of an array

    INDEX won't work on an array of objects, I'm afraid.
    Remember what the dormouse said
    Feed your head

  3. #3
    Forum Contributor
    Join Date
    02-23-2006
    Location
    Near London, England
    MS-Off Ver
    Office 2003
    Posts
    770

    Re: Cycling through 1 dimension of an array

    Ah, that explains that then

    I guess it'll be a two array approach then

    thanks

  4. #4
    Forum Contributor
    Join Date
    08-02-2007
    Location
    Panama & Austria
    MS-Off Ver
    2003 & 2010
    Posts
    186

    Re: Cycling through 1 dimension of an array

    Hi Phil_V,
    Have you tried the UBOUND tool?

    Please Login or Register  to view this content.

+ Reply to Thread

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