troubleshooting Question

Enter Formula into cell below filtered list using VBA

Avatar of Andreas Hermle
Andreas HermleFlag for Germany asked on
VBAMicrosoft ExcelMicrosoft Office
4 Comments1 Solution107 ViewsLast Modified:
Dear Experts:

I would like to enter the formula in line 7 in another way, i.e. no hardcoding of the range.

The Formula is to be entered into Column A, two cells below the last filled cell of the filtered list no matter how many rows there are.

Help is much appreciated. Thank you very much in advance.

Regards, Andreas


Sub Enter_SubTotal_End_of_Filtered_List()


    ThisWorkbook.Worksheets("3_Gesamtliste").Range("A1:M" & Range("A" & Rows.Count).End(xlUp).Row).AutoFilter Field:=4, Criteria1:="="
    
    
        Range("A13980").Formula = Application.WorksheetFunction.Subtotal(9, Range("A1:A" & Range("B" & Rows.Count).End(xlUp).Row))
      
  
End Sub
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros