Results 1 to 7 of 7

Subtotal a filtered range grrrr

Threaded View

  1. #1
    Forum Contributor
    Join Date
    05-09-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    259

    Subtotal a filtered range grrrr

    Hi all, I have a piece of code which works fine if you change the
    Criteria1
    in the macro which is not efficient as there are many filter ranges. I did comment the filter range out and just filter it manually on the spreadsheet but the formula does not get added to the cell, its fine when not filtered but as soon as it has a filter it doesnt work, thanks for the advice and help yesterday but it's still not right and I cant see whats wrong with it.


    Sub Filter_Sum()
    
    Set W1 = Worksheets("Master")
    
    Set Lastrow = W1.Cells(Rows.Count, "I").End(xlUp).Offset(2, 0)
     
     
     'With W1.Range("A1").CurrentRegion
      '  .AutoFilter
       ' .AutoFilter Field:=20, Criteria1:="340"
    'End With
    
    Lastrow.FormulaR1C1 = "=SUBTOTAL(109,R2C:R[-1]C)"
    
    
    
    End Sub
    Last edited by Hurricanefly; 05-16-2013 at 07:30 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1