+ Reply to Thread
Results 1 to 4 of 4

Can 1 row of multi-dimen array, be passed as its own array?

  1. #1
    Registered User
    Join Date
    02-17-2019
    Location
    Missouri, USA
    MS-Off Ver
    2016
    Posts
    2

    Can 1 row of multi-dimen array, be passed as its own array?

    Hello all. I would like to know if VBA allows the passing in a procedure call, of 1 row of a multi-dimen array, which is then treated as a 1-dimen array in the procedure that is called. In all my tests, my belief is no it's not possible, but then again I'm also not sure if my syntax has been correct for declaring this array in the params of the called procedure, or for how I'm passing the 1 row in the parentheses of the procedure call, or for the data type in the called procedure. Since I'm uncertain of these things because of how at times the runtime and compile error messages are cryptic, I figured hey it can't hurt to ask.

    2 procedures below, the first loads up a 2-dimen array with just something random I thought of while I was typing this message. Then the 2nd procedure is called with only 1 row of this 2-dimen array. My reason for being so curious about this is because I have a circumstance of wanting to act on only 1 row at a time of multiple 2-dimen arrays.

    Or maybe the only way to do such a method is to pass each row's members individually in the procedure call itself?

    Thank you and have an awesome day
    =========================================================
    Please Login or Register  to view this content.
    ...........or what about using a For Each loop on the items in just a specific row of the 1st dimension of the array....
    Please Login or Register  to view this content.
    Last edited by Lephramla; 02-25-2019 at 08:02 PM. Reason: Thought of another rendition/version to ask about

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,625

    Re: Can 1 row of multi-dimen array, be passed as its own array?

    Please Login or Register  to view this content.
    Last edited by protonLeah; 02-25-2019 at 11:42 PM.
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    02-17-2019
    Location
    Missouri, USA
    MS-Off Ver
    2016
    Posts
    2

    Re: Can 1 row of multi-dimen array, be passed as its own array?

    Thank you THANK YOU Ben! A huge monstrous "thank you"!! A member function or whatever of WorksheetFunction...nope, wouldn't have thought of exploring that group, but then I'm still kinda' new to the language & nuances of VBA. And the way you illustrate the use of this one row inside the called subroutine is fantasimo, thank you mucho again. This is double-mucho awesome to learn, and besides I'm now thinking it's time I take a look-see at all the WorksheetFunction members/whatever to see what other gems might just be there. The only other I've learned about so far is "Transpose". Would've read this and replied sooner but my time is pretty busy with various things.

    Thank you again Ben, and have an awesome day :-)
    Kirby

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,625

    Re: Can 1 row of multi-dimen array, be passed as its own array?

    You're welcome.

+ 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. [SOLVED] Regular formula or array for multi colum multi criteria?
    By scaffdog845 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-25-2016, 01:40 PM
  2. [SOLVED] How to return the most recently passed date from array
    By ineedthisspread in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-21-2013, 08:45 AM
  3. Truncating Array when passed to String
    By Dralky in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-01-2013, 05:01 AM
  4. [SOLVED] Issue with array created from value passed from function
    By g8r777 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-10-2012, 08:32 PM
  5. Redim Preserve a multi-dimen. array.
    By david90 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-08-2012, 03:41 PM
  6. Single Conditional Array x two Multi-Column Array - Approach needed
    By David Brown in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-28-2010, 11:41 AM
  7. Excel VBA: Can an array be passed from one userform to another?
    By BigBas in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-19-2008, 04:32 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