+ Reply to Thread
Results 1 to 5 of 5

What is wrong with this code? (Extract Row from 2D array to 1D array)

  1. #1
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Angry What is wrong with this code? (Extract Row from 2D array to 1D array)

    I'm getting really frustrated. I have this code and I can't work out why it isn't working. (The intRowToReturn is Variant instead of integer/long because I have to pass a project level byte to this function. Surely this isn't the cause? or is it?)

    Please Login or Register  to view this content.
    *******************************************************

    HELP WANTED! (Links to Forum threads)
    Trying to create reusable code for Custom Events at Workbook (not Application) level

    *******************************************************

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,359

    Re: What is wrong with this code? (Extract Row from 2D array to 1D array)

    Please Login or Register  to view this content.
    Did you really want to Erase the incoming array?
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: What is wrong with this code? (Extract Row from 2D array to 1D array)

    Can't you just use index?

    http://www.excelforum.com/tips-and-t...2d-arrays.html

  4. #4
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: What is wrong with this code? (Extract Row from 2D array to 1D array)

    Thank you +1

    Quote Originally Posted by Andy Pope View Post
    Did you really want to Erase the incoming array?
    Yes I do (and thanks for checking). I want to extract the one relevant row from the input array as a new array. I have no use for the input array afterwards.

  5. #5
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: What is wrong with this code? (Extract Row from 2D array to 1D array)

    Quote Originally Posted by Kyle123 View Post
    Can't you just use index?
    I might if I knew how to write the code as Index (I'm not familiar with use of Index). But I haven't got the time/patience to work that out. Andy Pope has provided working code and as long the code works for me, I'm happy.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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