Auto Filter Based On Cell Value [Closed]

Report
Posts
3
Registration date
Monday January 12, 2015
Status
Member
Last seen
January 13, 2015
-
Posts
3
Registration date
Monday January 12, 2015
Status
Member
Last seen
January 13, 2015
-
Hello,

I have a huge database and ever growing.

I need to filter based on a cell value Summary!C2 this value is selected from a drop down list.


The data base is located in Budgets! From Column A:AE I would like to filter Column C (L5 Grand). The rows are growing everyday based on automatic input via SQL servers etc...


Can someone please help me with the correct code to use for this.

I have looked at:
http://ccm.net/forum/affich-607114-auto-filter-depending-on-cell-value
But can't seem to get the code correct.

Also, after this is done I would like to sort the Data in Budgets! Column D (L5 Parent)

Can someone please assist, Thank you!!


3 replies

Try this.
Copy the VBA into the Summary sheet code space.


Private Sub Worksheet_Change(ByVal Target As Range)

Sheets("Budgets").Range("$A1:$AE6535").AutoFilter Field:=3, Criteria1:=Sheets("Summary").Range("C2")

Sheets("Budgets").AutoFilter.Sort.SortFields.Clear
Sheets("Budgets").AutoFilter.Sort.SortFields.Add Key:= _
Range("D1:D65535"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
With Sheets("Budgets").AutoFilter.Sort
.Header = xlYes
.Apply
End With
End Sub
2
Thank you

A few words of thanks would be greatly appreciated. Add comment

CCM 2942 users have said thank you to us this month

Posts
3
Registration date
Monday January 12, 2015
Status
Member
Last seen
January 13, 2015

Thank you RayH,

I will try it today and give you feedback!
Posts
3
Registration date
Monday January 12, 2015
Status
Member
Last seen
January 13, 2015

Hi RayH,

I didn't work :( I get the following error!

The error is on the second line of code: "Sheets("Budgets")........"

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!