Create array based on criteria in another array, and add to it

  • Hello,

    I'm new to VBA and I'm confused with arrays, other than they calculate at huge speed, which is what I want.


    This sample code works perfectly, but i want to do the next step which is rather than put values into worksheet cells, i want to add them to a temporary array then perform counts, averages, medians etc then clear the array. I have 29 variables, and 4 quarters & yearly data that I am processing.


    The output is a report, nicely formatted for end-users. I realise I might not be using vba and arrays to their full potential, but things are working well. I've searched forums, but I can't find a response that I can understand



    Repeats for 3 Q and whole year. I perform calculations and put them in the report, and there is 'clear' function at the start


    I basically need help to construct code to replace wsTMP.Range ("A2").Offset (RowQ1) to store in an array (1 dim), on which I can perform calcs, then clear it.

    Basic? Yep but I just can't get my head around single column arrays.


    Thanks in anticipation!

  • Welcome to the Forum. Please read the Forum Rules to understand how the Forum works and why I have added Code Tags to your post


    All VBA code posted in the forum must be wrapped in code tags, which you omitted, including single-line code snippets.Be sure to use them in future posts.


    How to use code tags


    Just highlight all of the code and press the <> in the post menu above button to add the code tags.


    Thanks.

Participate now!

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