We help IT Professionals succeed at work.
Get Started

Enter Formula into cell below filtered list using VBA

106 Views
Last Modified: 2017-04-06
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

Open in new window

Comment
Watch Question
CERTIFIED EXPERT
Top Expert 2016
Commented:
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE