+ Reply to Thread
Results 1 to 3 of 3

Generating a multi-dimensional array in a function, returning it, passing it to function

  1. #1
    Registered User
    Join Date
    02-10-2013
    Location
    Frankfurt, Germany
    MS-Off Ver
    Excel 2003
    Posts
    57

    Generating a multi-dimensional array in a function, returning it, passing it to function

    Hi,

    I still can't figure out how to pass arrays to and from functions. Can anyone help me?

    I want to create a two-dimensional array in one function, then pass it to another function. This code, is working fine:
    Please Login or Register  to view this content.
    However, If I try to separate this out into seperate functions, it doesn't work:

    Please Login or Register  to view this content.
    Can someone please tell me what I'm doing wrong? Many thanks!

  2. #2
    Forum Guru shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,649

    Re: Generating a multi-dimensional array in a function, returning it, passing it to functi

    One way:

    (See attachment for code; the forum isn't cooperating)

    A
    B
    C
    1
    123
    OneTwoThree B1: =ReplaceDigits(A1)


    See VBA Help for Understanding Scope and Visibility
    Attached Files Attached Files
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Guru
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,698

    Re: Generating a multi-dimensional array in a function, returning it, passing it to functi

    @Monkihunta :
    Please Login or Register  to view this content.
    @shg :
    The forum dislike the "Replace" function ( "Replace" word immediately followed by "(" ), so, use the Replace$() function instead (if the expected return datatype is string).

+ 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. Function which defines n-dimensional array, function inputs as variable.
    By jakopak in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-13-2016, 08:35 AM
  2. Help converting one-dimensional array to multi-dimensional array
    By puzzlelover22 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-13-2016, 06:48 AM
  3. Returning Two Dimensional Array from a Function
    By mahmud1280 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-18-2015, 12:50 PM
  4. Passing Multi-Dimensional Arrays
    By dldecler in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-28-2011, 02:03 PM
  5. WorkSheet Function with Multi Dimensional Array
    By lopiner in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-04-2010, 02:54 PM
  6. [SOLVED] Excel vba - passing a 3-dimensional array to a subroutine
    By joran6@sbcglobal.net in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-28-2006, 02:55 PM
  7. 2 dimensional array and freq function?
    By dabith in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-06-2005, 04:56 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