Storyteller
Instructor
Hello All,
I am using the "subtotal" menu command to group and subtotal a list of information. The code created is the following:
The issue is that the number of colums in the Array() changes. The first value is always 6 however the ending column number may change. As the range of data will change on a regular basis.
I use the following to determine the last column number:
So if FC equals 9, I want the Array() to have the value of Array(6,7,8,9)
What I am stuck on is how to change the Array() values. I have found the ParamArray(), but I have not been able to figure it out or perhaps there is another solution?
Any suggestions would be greatly appreciated.
Regards,
Michael
I am using the "subtotal" menu command to group and subtotal a list of information. The code created is the following:
Code:
Selection.Subtotal GroupBy:=1, Function:=xlSum, TotalList:=Array(6,7,8), _
Replace:=True, PageBreaks:=False, SummaryBelowData:=True
The issue is that the number of colums in the Array() changes. The first value is always 6 however the ending column number may change. As the range of data will change on a regular basis.
I use the following to determine the last column number:
Code:
FC = Cells(1, Columns.Count).End(xlToLeft).Column
So if FC equals 9, I want the Array() to have the value of Array(6,7,8,9)
What I am stuck on is how to change the Array() values. I have found the ParamArray(), but I have not been able to figure it out or perhaps there is another solution?
Any suggestions would be greatly appreciated.
Regards,
Michael