Array values becoming Null after Public sub closed

  • Respected Members seeking your inputs


    I have public sub where i am storing the values in array and that is called thru main function it picks values rightly and stores it in list but when the Sub ends it does not retain value.


    Kindly share your inputs on retaining value


  • Which module is the arrlist declaration in, and how are you determining that it is empty after the sub runs?


    As a side note, using Redim Preserve is not very efficient and totally unnecessary here as you can simply size the array at the start based on the number of cells in the range.

    Rory
    Theory is when you know something, but it doesn’t work. Practice is when something works, but you don’t know why. Programmers combine theory and practice: nothing works and they don’t know why

  • I was able to determine it is empty by putting a watch on the field arrlist, i am still learning its probably how i am using the list, i had used array list in include and exclude function in Macros it is working fine but now when i am using in the loop to get the index values it is empty, its probably the declaration. i am going to try this in variant, i had somehow declared it as string.

  • Try


Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!