Grouping a VBA Array

  • I have the code below which groups a via array. Everything seems to work however the code is very ugly with multiple goto statements. I would like to clean it up and improve the readability.


    Here is the starting array and the ending array.

  • This a very easy task if you are willing to use Power Query. To demo this, instead of a picture (which I cannot manipulate), please upload your sample file.


    Grouping is one of the simplest tasks that you can perform in Power Query which is on your Data Tab of the Ribbon. In your version, it is called Get and Transform Data.

  • This a very easy task if you are willing to use Power Query. To demo this, instead of a picture (which I cannot manipulate), please upload your sample file.


    Grouping is one of the simplest tasks that you can perform in Power Query which is on your Data Tab of the Ribbon. In your version, it is called Get and Transform Data.

    You cant use power query with VBA arrays I believe. The code sent is probably quicker then writing to the workbook > using power query > writing results to workbook and then reading results to the ending array

Participate now!

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