strange problem subtotal

H

hans

I use the following code:
Selection.Subtotal GroupBy:=7, Function:=xlSum, TotalList:=Array(4, 5), _
Replace:=True, PageBreaks:=False, SummaryBelowData:=True
Selection.Subtotal GroupBy:=8, Function:=xlSum, TotalList:=Array(4, 5),
_
Replace:=False, PageBreaks:=False, SummaryBelowData:=True

Collum 7 cantains the name of the persons
Collum 8 contains the tpe of expences they make

This works correct for the first person
It gifs the subtotal of the last expenses type and then the total of the
person of all expenses

For all later persons is goes wrong
Now it gifs (after the last expense)
The total of all expenses of this person
and on the next line it shows the total of last expenses type
(It is swapt)

What is going wrong?

Greetings Hans

PS i use excel 2003
 
F

Fredrik Wahlgren

hans said:
I use the following code:
Selection.Subtotal GroupBy:=7, Function:=xlSum, TotalList:=Array(4, 5), _
Replace:=True, PageBreaks:=False, SummaryBelowData:=True
Selection.Subtotal GroupBy:=8, Function:=xlSum, TotalList:=Array(4, 5),
_
Replace:=False, PageBreaks:=False, SummaryBelowData:=True

Collum 7 cantains the name of the persons
Collum 8 contains the tpe of expences they make

This works correct for the first person
It gifs the subtotal of the last expenses type and then the total of the
person of all expenses

For all later persons is goes wrong
Now it gifs (after the last expense)
The total of all expenses of this person
and on the next line it shows the total of last expenses type
(It is swapt)

What is going wrong?

Greetings Hans

PS i use excel 2003

I think this article will help
http://support.microsoft.com/kb/831824

/Fredrik
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Subtotal Formatting 2
Subtotal by VBA 5
subtotal question 1
Subtotals 2
Subtotal function 2
Using Subtotal: How to update TotalList:= 2
Subtotal macro in each worksheet 13
sub total array 1

Top