+ Reply to Thread
Results 1 to 3 of 3

I've written a multi-dimensional Array to String, but need HELP to reverse it!

  1. #1
    Registered User
    Join Date
    03-22-2009
    Location
    Antwerp
    MS-Off Ver
    Excel 2002 SP2
    Posts
    45

    I've written a multi-dimensional Array to String, but need HELP to reverse it!

    I made a function that will convert almost anything to a string, including a multi-dimensional array!

    'example1:
    Debug.Print fStr(array(1 to 2, 1 to 2)) '>>> (("11","21"),("21","12"))

    'example2:
    ReDim arr(1 To 2, 1 To 3) As Variant
    arr(1, 1) = "11" & Chr(13)
    arr(2, 1) = 21
    arr(1, 2) = Array(Null, 1)
    arr(2, 2) = True
    Set arr(1, 3) = ActiveCell
    Set arr(2, 3) = Nothing
    Debug.Print fStr(arr) '>>> (("11[13]",21),((Null,1),True),(Sheet1!A1,Nothing))

    Now I want to reverse it, but I can't find a way to Dim or Redim a multi-dimensional array that could have 1 up to 6000 dimensions!
    The amount of "(" at the beginning of the string tells how many dimensions, but I don't want to add 6000 lines with each line having a Redim with one more dimension!

    So how can I use a variable as the Redim multi-dimensional parameter ???

    So I need to find a solution that looks like this:
    d="1 to 2, 1 to 3"
    Redim arr(d)

    or like this:
    fReDim "1 to 2", "1 to 3"
    Sub fReDim (ParamArray d() As string)
    Redim arr(d())
    end Sub

    Any help appreciated, thank you.


    Oh yeah, for those that are looking for a function that converts anything to a string: Book1.xlsm

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: I've written a multi-dimensional Array to String, but need HELP to reverse it!

    Your post does not comply with Rule 8 of our Forum RULES. Do not crosspost your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).

    http://www.mrexcel.com/forum/excel-q...p-reverse.html
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Registered User
    Join Date
    03-22-2009
    Location
    Antwerp
    MS-Off Ver
    Excel 2002 SP2
    Posts
    45

    Re: I've written a multi-dimensional Array to String, but need HELP to reverse it!

    I'm sorry, I forgot to copy the link.

+ 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. Set up a multi-dimensional array
    By penfold1992 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-04-2013, 04:28 AM
  2. [SOLVED] Dim multi dimensional array
    By jdfjab in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-06-2012, 09:08 AM
  3. Multi-Dimensional Named Array
    By yawnzzzz in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-22-2008, 12:28 PM
  4. [SOLVED] Multi Dimensional Array
    By andym in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-10-2006, 03:29 AM
  5. [SOLVED] Multi-Dimensional Array Let & Get
    By Trip in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-21-2005, 04:05 PM

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