Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
    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

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


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.