#1   Report Post  
Posted to microsoft.public.excel.misc
pol pol is offline
external usenet poster
 
Posts: 129
Default Help for subtotal

Please help in the following example how I can give end of column
instead of O193


ActiveCell.FormulaR1C1 = "=SUBTOTAL(9,O3:O193)"

with thanks and regards

Pol
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Help for subtotal

Hi,

Maybe this

lastrow = Cells(Rows.Count, "O").End(xlUp).Row
ActiveCell.Formula = "=SUBTOTAL(9,O3:O" & lastrow & ")"

Mike

"pol" wrote:

Please help in the following example how I can give end of column
instead of O193


ActiveCell.FormulaR1C1 = "=SUBTOTAL(9,O3:O193)"

with thanks and regards

Pol

  #3   Report Post  
Posted to microsoft.public.excel.misc
pol pol is offline
external usenet poster
 
Posts: 129
Default Help for subtotal while filtering

Thanks Mike,


When I am using that formula , the subtotal is showing just last line of the
column. I want the the subtotal should be shown at the end of the data. But
when I am executing that formula , the result will be overwritten the data on
the last line . So I given the following mathod but it is not working when I
am filtering

With ActiveSheet
LastRow = .Cells(.Rows.Count, "B").End(xlUp).Row
.Range("O2:O" & LastRow).FormulaR1C1 = .Range("O2").FormulaR1C1
End With
Range("O" & LastRow + 1).Select
LastRow = Cells(Rows.Count, "O").End(xlUp).Row
ActiveCell.Formula = "=SUBTOTAL(9,O3:O" & LastRow & ")"

Please Help

"Mike H" wrote:

Hi,

Maybe this

lastrow = Cells(Rows.Count, "O").End(xlUp).Row
ActiveCell.Formula = "=SUBTOTAL(9,O3:O" & lastrow & ")"

Mike

"pol" wrote:

Please help in the following example how I can give end of column
instead of O193


ActiveCell.FormulaR1C1 = "=SUBTOTAL(9,O3:O193)"

with thanks and regards

Pol

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Help for subtotal while filtering

see your latest post

"pol" wrote:

Thanks Mike,


When I am using that formula , the subtotal is showing just last line of the
column. I want the the subtotal should be shown at the end of the data. But
when I am executing that formula , the result will be overwritten the data on
the last line . So I given the following mathod but it is not working when I
am filtering

With ActiveSheet
LastRow = .Cells(.Rows.Count, "B").End(xlUp).Row
.Range("O2:O" & LastRow).FormulaR1C1 = .Range("O2").FormulaR1C1
End With
Range("O" & LastRow + 1).Select
LastRow = Cells(Rows.Count, "O").End(xlUp).Row
ActiveCell.Formula = "=SUBTOTAL(9,O3:O" & LastRow & ")"

Please Help

"Mike H" wrote:

Hi,

Maybe this

lastrow = Cells(Rows.Count, "O").End(xlUp).Row
ActiveCell.Formula = "=SUBTOTAL(9,O3:O" & lastrow & ")"

Mike

"pol" wrote:

Please help in the following example how I can give end of column
instead of O193


ActiveCell.FormulaR1C1 = "=SUBTOTAL(9,O3:O193)"

with thanks and regards

Pol

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 383
Default Help for subtotal while filtering



"Mike H" wrote:

see your latest post

"pol" wrote:

Thanks Mike,


When I am using that formula , the subtotal is showing just last line of the
column. I want the the subtotal should be shown at the end of the data. But
when I am executing that formula , the result will be overwritten the data on
the last line . So I given the following mathod but it is not working when I
am filtering

With ActiveSheet
LastRow = .Cells(.Rows.Count, "B").End(xlUp).Row
.Range("O2:O" & LastRow).FormulaR1C1 = .Range("O2").FormulaR1C1
End With
Range("O" & LastRow + 1).Select
LastRow = Cells(Rows.Count, "O").End(xlUp).Row
ActiveCell.Formula = "=SUBTOTAL(9,O3:O" & LastRow & ")"

Please Help

"Mike H" wrote:

Hi,

Maybe this

lastrow = Cells(Rows.Count, "O").End(xlUp).Row
ActiveCell.Formula = "=SUBTOTAL(9,O3:O" & lastrow & ")"

Mike

"pol" wrote:

Please help in the following example how I can give end of column
instead of O193


ActiveCell.FormulaR1C1 = "=SUBTOTAL(9,O3:O193)"

with thanks and regards

Pol

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
macro excel subtotal in subtotal GBO Excel Discussion (Misc queries) 2 November 29th 07 02:15 PM
How do I Subtotal, then Sort by Subtotal Amounts? dnamertz Excel Discussion (Misc queries) 3 October 29th 06 12:17 AM
pasting to subtotal lines without replacing hidden -non-subtotal l harleydiva67 Excel Discussion (Misc queries) 1 October 12th 06 06:02 PM
Bolding the subtotal lines automaticlly When using the Subtotal fu 06Speed6 New Users to Excel 2 October 5th 06 03:52 PM
Subtotal of Subtotal displays Grand Total in wrong row Thomas Born Excel Worksheet Functions 5 January 6th 05 01:46 PM


All times are GMT +1. The time now is 02:38 AM.

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

About Us

"It's about Microsoft Excel"