Auto Filter Based On Cell Value

Closed
IzakG Posts 3 Registration date Monday January 12, 2015 Status Member Last seen January 13, 2015 - Jan 13, 2015 at 12:03 AM
IzakG Posts 3 Registration date Monday January 12, 2015 Status Member Last seen January 13, 2015 - Jan 13, 2015 at 04:59 PM
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!!


Related:

3 responses

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
IzakG Posts 3 Registration date Monday January 12, 2015 Status Member Last seen January 13, 2015
Jan 13, 2015 at 04:29 PM
Thank you RayH,

I will try it today and give you feedback!
0
IzakG Posts 3 Registration date Monday January 12, 2015 Status Member Last seen January 13, 2015
Jan 13, 2015 at 04:59 PM
Hi RayH,

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

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

0