Add single value to a multidimensional array vba and then redim -


I'm running in a few issues to populate a multi-dimensional version array. What I am trying to do is add a single value to the array in line 1, column 1. Although the following code does not work arr arr (1,1) = 3

building on it, when I If you want to add more value to the array, some conditions are met, for example C = 2 to 10001 sheets ("data"). If the range ("P" & amp; c) = branch and range ("Q" & amp; c) = department and

 range ("R" & amp; c) = subdept then arr (UBound (Arr) + 1, 1) = range ("A" & amp; C) end if the next c   

the loop is finished and I have it in variable length as the array After that, I have ended the extract of values. However,

  Redim arr ()   

is not working either. Also, I should say that I do not have any real need to be multi-functional, just the variables in size Saying, I do not know a way to create 1 dimensional dynamic array in VBA

In short

1) Why arr (1,1) throw me an error?

2) Why Redim arr () throw me an error? (I do not want to reduce a certain size)

3) Is there any way to create dynamic 1D array in VBA?

Note: I think that I can manipulate the 1D 100 length array which I can fill in the number of values ​​filled in it and decrease it as (0 to 100) But first, I want to know whether there is any answer to the questions given above.

Many thanks.

Update: (My second attempt: still fails on the arr (arrLen, 1) = Category ("A" & amp; c))

  arrLen = 1c = 2 to 10001 sheet ("data"). If the range and range ("Q" and "C") = range and range ("R" & amp; c) = subdept then redeem ARR (Aronel to 1) ARR (Airline , 1) = Range ("A" and C) ARLN = ARL + 1 and if next C    

Div class = "post-text" itemprop = "text">

Work code below. Choose 10001 sheets ("data") for c = 2 as the option base 1 dim arr () string arrLen = 1. If the range ("P" & amp; c) = Branch and Range ("Q" & amp; c) = Department and Range ("R" & amp; c) = subdep then Redeem Protected Arr (1 arrLen) arr ArrLen) = Category ("A" & amp; C) arrLen = arrLen + 1 end if next c

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -