Drop Down Items Filter Data. Only First Item works

ss6857

New Member
Joined
Jan 17, 2011
Messages
27
Hello,

I have Data that is pulled from an outside database. I have the data filtered by group number and date. half the data is copied onto on worksheet, the other half on another worksheet. Each work sheet specifies a date for their respective data. It works perfectly for the first date option. However, if I try any of the other 2 dates, it does not filter. (actually it takes away all of the data). Here is my code:

Code:
ActiveSheet.ListObjects("Table_Query_from_BucketSQL").Range.AutoFilter Field _
        :=15, Criteria1:="1"
    ActiveSheet.ListObjects("Table_Query_from_BucketSQL").Range.AutoFilter Field _
        :=14, Criteria1:="=*" & Sheets("JoAnn").Range("JoAnnDate").Value & "*"

Here is my code for the other worksheet:
Code:
ActiveSheet.ListObjects("Table_Query_from_BucketSQL").Range.AutoFilter Field _
        :=15, Criteria1:="2"
    ActiveSheet.ListObjects("Table_Query_from_BucketSQL").Range.AutoFilter Field _
        :=14, Criteria1:="=*" & Sheets("JoAnn").Range("AmyDate").Value & "*"

Any help would be great.
Thank you!
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
and it still doesn't work. sorry i shouldve specified that i didn't figure it out, it was just an error when putting it on this question.
 
Upvote 0
I have 3 dates in a drop down box, when I change the drop down option a macro runs. However only one of the options work. Here is my code:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$E$2" Then
Application.Run "JoAnn"
End If
End Sub

Code:
Sub JoAnn()
Application.ScreenUpdating = False
Dim LastRow As Long
Dim Delete As Long
ActiveWorkbook.RefreshAll
Delete = Range("A5").End(xlDown).Row
    Range("A5:M" & Delete & "").Select
    Selection.ClearContents
Sheets("Data").Select
LastRow = Range("A2").End(xlDown).Row
    
    ActiveSheet.ListObjects("Table_Query_from_BucketSQL").Range.AutoFilter Field _
        :=15, Criteria1:="1"
    ActiveSheet.ListObjects("Table_Query_from_BucketSQL").Range.AutoFilter Field _
        :=14, Criteria1:="=*" & Sheets("Control").Range("JoAnnDate").Value & "*"
    Range("A2:M" & LastRow & "").Select
    Selection.Copy
    Selection.SpecialCells(xlCellTypeVisible).Select
    Sheets("JoAnn").Select
    Range("A5").Select
    ActiveSheet.Paste
    
    Sheets("Data").Select
    ActiveSheet.ListObjects("Table_Query_from_BucketSQL").Range.AutoFilter Field _
        :=14
    ActiveSheet.ListObjects("Table_Query_from_BucketSQL").Range.AutoFilter Field _
        :=15
    Sheets("JoAnn").Select
    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
    Selection.Borders(xlEdgeLeft).LineStyle = xlNone
    Selection.Borders(xlEdgeTop).LineStyle = xlNone
    Selection.Borders(xlEdgeBottom).LineStyle = xlNone
    Selection.Borders(xlEdgeRight).LineStyle = xlNone
    Selection.Borders(xlInsideVertical).LineStyle = xlNone
    Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
    Selection.NumberFormat = "_(* #,##0_);_(* (#,##0);_(* ""-""_);_(@_)"
    With Selection.Interior
        .Pattern = xlNone
        .TintAndShade = 0
        .PatternTintAndShade = 0
    End With
    Range("A5").Select
    
Application.ScreenUpdating = True
    
End Sub

Any help would be appreciated..
 
Upvote 0

Forum statistics

Threads
1,224,534
Messages
6,179,391
Members
452,909
Latest member
VickiS

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top