[RESOLVED] [Excel] Problem with dynamic arrays
I've got an Excel file I'm working on in which I've got some dynamic arrays I need to use. I have them declared up in Option Explicit, and their size is first defined in my main function.
Code:
Option Explicit
Dim array_temp() As Integer
Dim array_rt() As Integer
Sub DrawSignal()
ReDim array_rt((num_results + 1), (num_results)) As Integer
ReDim array_temp(num_results + 1) As Integer
End Sub
Unfortunately, I need to use them again in multiple functions, but for some reason they keep coming up as Invalid Qualifiers. I've tried using ReDim Preserve to reset the size while still keeping the data, but it's still giving the same error. How can I get it to recognize the arrays?
Re: [Excel] Problem with dynamic arrays
When you use Redim Preserve are you trying to adjust more than 1 dimension? I believe only the last dimension can be adjusted. If that's not what you are doing, I think we need more specifics about the error. You might also want to check the values of the your variables just prior to the Redim Preserve statement.
Re: [Excel] Problem with dynamic arrays
you don't need the as integer when you redim
Re: [Excel] Problem with dynamic arrays
Thanks for the replies, but I managed to fix it. Apparently the problem wasn't with the redim at all, but with something else I had overlooked. -_-