Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
NuB NuB is offline
external usenet poster
 
Posts: 9
Default add a new row

Currently in code i'm populating an excel file and grouping the data, now I
need to add a row with a total for each group, in code how can i add a total
of each group?

Example:
BMW
25,463
69,000
12,000

Total 106,463
Lexus
72,000
25,000
13,000
total 110,000

how can i accomplish something like this?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default add a new row

Sort your date on the column
In the menu in Excel go to
Data=Subtotals
(then follow the wizard)
If you want a macro, turn on the macro recorder while you apply it.

Another approach would be to create a pivot table (also under the data
menu).

--
Regards,
Tom Ogilvy

"NuB" <CSharpCoder wrote in message
...
Currently in code i'm populating an excel file and grouping the data, now

I
need to add a row with a total for each group, in code how can i add a

total
of each group?

Example:
BMW
25,463
69,000
12,000

Total 106,463
Lexus
72,000
25,000
13,000
total 110,000

how can i accomplish something like this?




  #3   Report Post  
Posted to microsoft.public.excel.programming
NuB NuB is offline
external usenet poster
 
Posts: 9
Default add a new row

all of those solutions sound great and would work in most cases, but not in
my case. Since I'm populating the file on the fly via .NET is there another
way to do this or no?

"Tom Ogilvy" wrote in message
...
Sort your date on the column
In the menu in Excel go to
Data=Subtotals
(then follow the wizard)
If you want a macro, turn on the macro recorder while you apply it.

Another approach would be to create a pivot table (also under the data
menu).

--
Regards,
Tom Ogilvy

"NuB" <CSharpCoder wrote in message
...
Currently in code i'm populating an excel file and grouping the data, now

I
need to add a row with a total for each group, in code how can i add a

total
of each group?

Example:
BMW
25,463
69,000
12,000

Total 106,463
Lexus
72,000
25,000
13,000
total 110,000

how can i accomplish something like this?






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default add a new row

sure, loop through the data and insert a line when the values in the column
change. Then put in a summation formula. Although, if you can do that, it
is unclear why either of the other methods wouldn't work.

--
Regards,
Tom Ogilvy


"NuB" <CSharpCoder wrote in message
...
all of those solutions sound great and would work in most cases, but not

in
my case. Since I'm populating the file on the fly via .NET is there

another
way to do this or no?

"Tom Ogilvy" wrote in message
...
Sort your date on the column
In the menu in Excel go to
Data=Subtotals
(then follow the wizard)
If you want a macro, turn on the macro recorder while you apply it.

Another approach would be to create a pivot table (also under the data
menu).

--
Regards,
Tom Ogilvy

"NuB" <CSharpCoder wrote in message
...
Currently in code i'm populating an excel file and grouping the data,

now
I
need to add a row with a total for each group, in code how can i add a

total
of each group?

Example:
BMW
25,463
69,000
12,000

Total 106,463
Lexus
72,000
25,000
13,000
total 110,000

how can i accomplish something like this?








  #5   Report Post  
Posted to microsoft.public.excel.programming
NuB NuB is offline
external usenet poster
 
Posts: 9
Default add a new row

what other methods?
I'm not using a template or a pivot table to show the data, i'm just
populating the cells and columns and showing the data that way.
"Tom Ogilvy" wrote in message
...
sure, loop through the data and insert a line when the values in the
column
change. Then put in a summation formula. Although, if you can do that,
it
is unclear why either of the other methods wouldn't work.

--
Regards,
Tom Ogilvy


"NuB" <CSharpCoder wrote in message
...
all of those solutions sound great and would work in most cases, but not

in
my case. Since I'm populating the file on the fly via .NET is there

another
way to do this or no?

"Tom Ogilvy" wrote in message
...
Sort your date on the column
In the menu in Excel go to
Data=Subtotals
(then follow the wizard)
If you want a macro, turn on the macro recorder while you apply it.

Another approach would be to create a pivot table (also under the data
menu).

--
Regards,
Tom Ogilvy

"NuB" <CSharpCoder wrote in message
...
Currently in code i'm populating an excel file and grouping the data,

now
I
need to add a row with a total for each group, in code how can i add a
total
of each group?

Example:
BMW
25,463
69,000
12,000

Total 106,463
Lexus
72,000
25,000
13,000
total 110,000

how can i accomplish something like this?












  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default add a new row

That is what I said. It is unclear why the other methods won't work. If
you don't want to use a pivot table, then there is still subtotal which
works inplace.

--
Regards,
Tom Ogilvy


"NuB" <CSharpCoder wrote in message
...
what other methods?
I'm not using a template or a pivot table to show the data, i'm just
populating the cells and columns and showing the data that way.
"Tom Ogilvy" wrote in message
...
sure, loop through the data and insert a line when the values in the
column
change. Then put in a summation formula. Although, if you can do

that,
it
is unclear why either of the other methods wouldn't work.

--
Regards,
Tom Ogilvy


"NuB" <CSharpCoder wrote in message
...
all of those solutions sound great and would work in most cases, but

not
in
my case. Since I'm populating the file on the fly via .NET is there

another
way to do this or no?

"Tom Ogilvy" wrote in message
...
Sort your date on the column
In the menu in Excel go to
Data=Subtotals
(then follow the wizard)
If you want a macro, turn on the macro recorder while you apply it.

Another approach would be to create a pivot table (also under the

data
menu).

--
Regards,
Tom Ogilvy

"NuB" <CSharpCoder wrote in message
...
Currently in code i'm populating an excel file and grouping the

data,
now
I
need to add a row with a total for each group, in code how can i add

a
total
of each group?

Example:
BMW
25,463
69,000
12,000

Total 106,463
Lexus
72,000
25,000
13,000
total 110,000

how can i accomplish something like this?












Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 07:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"