Heed help to do subtotals with unknown rows and columns

  • Dear Excel Helpers,


    I need your help in doing Subtotals on a file using VBA codes. The datafile I receive every month has unknown number of rows and columns, i.e., each file has rows and columns that are not fixed. I want to do three levels of subtotals on this file based on columns 2, 3, and 4 in that order. The subtotaling columns will start from column 8 to that last column with data in that file. What I cannot figure out is what to specify within the array in the subtotal function through vba codes when the number of columns are not known.


    Thank you for all help


    Angela

  • you specify the following:


    "The subtotaling columns will start from column 8 to that last column with data in that file"


    Did you mean row instead of column?
    Also, can your data contain spaces between entries?

  • Jong,


    Thanks for getting back to me. As for spaces between entries, the data set contains volumes and there can be zeros or no entries instead of zeros within the dataset. Since the number of columns is not known as well as the number of rows in the dataset, I want the subtotaling to start from column 8 and all the way to the last column in the file and all the way to all the rows in the file. From column onwards each column represents data for each month. I hope it is somewhat clear to you now.


    Thanks,


    Angela

Participate now!

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