Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm getting a Subtotal method of Range class failed Error when I try to run a macro in Excel 2007. Code works GREAT (no errors) when I run it using Excel 2003.

Here's a snippet...

'SubTotal Sheet
    Range("A1").Select
    Selection.Subtotal GroupBy:=1, Function:=xlSum, TotalList:=Array(3, 4, 5, 6, 7, _
        8, 9), Replace:=True, PageBreaks:=False, SummaryBelowData:=True

Any help would be appreciated.

share|improve this question

1 Answer 1

I recorded a macro in 2007 to see if there was any difference in the code and it's basically the same as what you have above. Could it be that the table has moved? A1 should be the top left of the range you want to subtotal. Are there breaks in the data? This could cause issues. Is the data properly sorted?

What errors are you getting in Excel 2007 when you run this code?

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.