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 me with this.

[VBA]

'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


[/VBA]


Please help
Julio