A
Austin
I am having some issue with this but not sure what it is. I am guessing the
Columns2 variant is not being created for one reason or another but have not
been able to figure out why. Thanks for the help:
ColStart = 2
ColEnd = lvlColumn + 2
ReDim Columns(0 To (ColEnd - ColStart))
For i = ColStart To ColEnd
Columns(i - ColStart) = i
Next i
ColSt = 3
ColEn = lvlColumn + 2
ReDim Columns2(0 To (ColEn - ColSt))
For i = (ColSt + 1) To ColEn
Columns(i - ColSt) = i
Next i
With xlSheet.Range("A:ZZ")
.Cells.Copy
.Cells.PasteSpecial (xlPasteValues)
.Subtotal GroupBy:=1, Function:=xlSum, TotalList:=Columns, _
Replace:=True, PageBreaks:=False, SummaryBelowData:=True
.Replace What:="0", Replacement:="", lookAt:=xlWhole
.Subtotal GroupBy:=2, Function:=xlSum, TotalList:=Columns2, _
Replace:=False, PageBreaks:=False, SummaryBelowData:=True
End With
Columns2 variant is not being created for one reason or another but have not
been able to figure out why. Thanks for the help:
ColStart = 2
ColEnd = lvlColumn + 2
ReDim Columns(0 To (ColEnd - ColStart))
For i = ColStart To ColEnd
Columns(i - ColStart) = i
Next i
ColSt = 3
ColEn = lvlColumn + 2
ReDim Columns2(0 To (ColEn - ColSt))
For i = (ColSt + 1) To ColEn
Columns(i - ColSt) = i
Next i
With xlSheet.Range("A:ZZ")
.Cells.Copy
.Cells.PasteSpecial (xlPasteValues)
.Subtotal GroupBy:=1, Function:=xlSum, TotalList:=Columns, _
Replace:=True, PageBreaks:=False, SummaryBelowData:=True
.Replace What:="0", Replacement:="", lookAt:=xlWhole
.Subtotal GroupBy:=2, Function:=xlSum, TotalList:=Columns2, _
Replace:=False, PageBreaks:=False, SummaryBelowData:=True
End With