#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Sum of each row.

Hi All,

i have created one xls file using c# Excel =
Microsoft.Office.Interop.Excel. DLL
and i have the data like below


A B C D
1 100 20 30
2 101 20 31
3 102 20 35
4 103 20 35
5 104 20 32


I need to do subtotal of each row. please help me out how to do ?


result will be like below


-------------------------------------------------------------
GrandTotal 510 100 163
-------------------------------------------------------------



oWSheet.get_Range("A1" , "D5" )).Subtotal(1,
Excel.XlConsolidationFunction.xlSum, Type.Missing,
(object)true, (object)true, Excel.XlSummaryRow.xlSummaryBelow);


i am using the above function but it gives only one row total only.
but i want 3 rows Grand Total individually like above.


thanks in advance.


regards
Rasheed


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15
Default Sum of each row.

On Dec 2, 12:21*pm, Rasheed wrote:
Hi All,

i have created one xls file using c# Excel =
Microsoft.Office.Interop.Excel. DLL
and i have the data like below

* * * A * * * * * B * * * * * *C * * * * *D
1 * * * * * * * * *100 * * * * 20 * * * *30
2 * * * * * * * * * 101 * * * * 20 * * * *31
3 * * * * * * * * * 102 * * * * 20 * * * *35
4 * * * * * * * * * 103 * * * * 20 * * * *35
5 * * * * * * * * * 104 * * * * 20 * * * *32

*I need to do subtotal of each row. please help me out how to do ?

result will be like below

-------------------------------------------------------------
GrandTotal * * * * 510 * * * * 100 * * *163
-------------------------------------------------------------

oWSheet.get_Range("A1" , "D5" )).Subtotal(1,
Excel.XlConsolidationFunction.xlSum, Type.Missing,
(object)true, (object)true, Excel.XlSummaryRow.xlSummaryBelow);

i am using the above function but it gives only one row total only.
but i want 3 rows Grand Total individually like above.

thanks in advance.

regards
Rasheed


=sum(B1:B5)
=sum(C1:C5), etc
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Sum of each row.

Hi SK,

I want the solution using c# code please.

regards
Rasheed
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,240
Default Sum of each row.

Rasheed wrote:
Hi SK,

I want the solution using c# code please.

regards
Rasheed



Well, this is the worksheet.functions group.

Maybe try the programming group.
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Sum of each row.

You'll probably have a better chance at getting a useful reply if you post
your question in a C# newsgroup.

--
Biff
Microsoft Excel MVP


"Rasheed" wrote in message
...
Hi SK,

I want the solution using c# code please.

regards
Rasheed





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 01:12 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"