I received the errorbox: "Subtotal method of Range class failed" with the below code. How can I fix this and how can I rewrite the code so that it can accommodate a changing number of columns to subtotal?
Range("A1").Select
Selection.Subtotal GroupBy:=3, Function:=xlSum, TotalList:=Array(14, 15, 16 _
, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, _
43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63), Replace:= _
True, PageBreaks:=False, SummaryBelowData:=True