ReDim Preserve “Subscript Out of Range”

前端 未结 1 1724
無奈伤痛
無奈伤痛 2020-12-20 13:43

I am trying to move data from 2 Double Arrays to 2 different Double Arrays. I\'m not sure what the size is going to be because I am taking a randomized sample out of the fi

相关标签:
1条回答
  • 2020-12-20 14:30

    To summarise the comments above into an answer:

    • You can only redim the last dimension of a multi dimension array

    Therefore in order to resize a multiple dimension array there are a couple of simple options:

    1. If only one dimension needs to be resized flip the loops and logic around so that the dimension to be resized becomes the last dimension
    2. If both dimensions must be resized use either an array of arrays or a collection of arrays and correct the loops as required
    0 讨论(0)
提交回复
热议问题