blastpwr1970
06-13-2006, 12:57 PM
Hi All,
I have a line of code that it suppouse to subtotal but when it tries to subtotal it tell me that the the command can not be completed using the specified range, so what I think, I have to do is bypass the subtotal if there is no data to subtotal, could somebody :help me with this.
'Subtotal code
Range("E1").Select
Selection.RemoveSubtotal
Range("E1").Select
Selection.Subtotal GroupBy:=23, Function:=xlCount, TotalList:=Array(23), _
Replace:=True, PageBreaks:=False, SummaryBelowData:=True
Selection.Subtotal GroupBy:=23, Function:=xlSum, TotalList:=Array(20), _
Replace:=False, PageBreaks:=False, SummaryBelowData:=True
Please help
Julio
I have a line of code that it suppouse to subtotal but when it tries to subtotal it tell me that the the command can not be completed using the specified range, so what I think, I have to do is bypass the subtotal if there is no data to subtotal, could somebody :help me with this.
'Subtotal code
Range("E1").Select
Selection.RemoveSubtotal
Range("E1").Select
Selection.Subtotal GroupBy:=23, Function:=xlCount, TotalList:=Array(23), _
Replace:=True, PageBreaks:=False, SummaryBelowData:=True
Selection.Subtotal GroupBy:=23, Function:=xlSum, TotalList:=Array(20), _
Replace:=False, PageBreaks:=False, SummaryBelowData:=True
Please help
Julio