Hello,
I have a workbook that is used to bring in raw data for POS transactions from multiple locations. The macro used is to filter the data on a summary page as well as on individual worksheets for each location so on each worksheet only that location's transactions show and they are filtered so all Visa, MC, AMEX or Debit are together and each has a subtotal as well as a location grand total.
The macro we use to filter the information worked well at first but now when we hit the filter button it sorts it so only each location's transactions show on their worksheet but the worksheet is not sorted to have each type of transaction together and there are no subtotals, just a grand total for each location. If we hit the filter button a second time then everything gets sorted and filtered correctly.
If anyone can help with two things. First, how do I fix this so we only have to hit the filter button once and second, is there a way to combine all these lines into one that will filter all worksheets?
The macro we are using is:
I have a workbook that is used to bring in raw data for POS transactions from multiple locations. The macro used is to filter the data on a summary page as well as on individual worksheets for each location so on each worksheet only that location's transactions show and they are filtered so all Visa, MC, AMEX or Debit are together and each has a subtotal as well as a location grand total.
The macro we use to filter the information worked well at first but now when we hit the filter button it sorts it so only each location's transactions show on their worksheet but the worksheet is not sorted to have each type of transaction together and there are no subtotals, just a grand total for each location. If we hit the filter button a second time then everything gets sorted and filtered correctly.
If anyone can help with two things. First, how do I fix this so we only have to hit the filter button once and second, is there a way to combine all these lines into one that will filter all worksheets?
The macro we are using is:
Code:
Sub FilterSheet()
'
' FilterSheet Macro
'
'
Sheets("(01)").Select
ActiveSheet.Range("$A$1:$A$3392").AutoFilter Field:=1, Criteria1:="<>"
Sheets("(03)").Select
ActiveSheet.Range("$A$1:$A$3392").AutoFilter Field:=1, Criteria1:="<>"
Sheets("(04)").Select
ActiveSheet.Range("$A$1:$A$3392").AutoFilter Field:=1, Criteria1:="<>"
Sheets("(07)").Select
ActiveSheet.Range("$A$1:$A$3392").AutoFilter Field:=1, Criteria1:="<>"
Sheets("(08)").Select
ActiveSheet.Range("$A$1:$A$3392").AutoFilter Field:=1, Criteria1:="<>"
Sheets("(09)").Select
ActiveSheet.Range("$A$1:$A$3392").AutoFilter Field:=1, Criteria1:="<>"
Sheets("(10)").Select
ActiveSheet.Range("$A$1:$A$3392").AutoFilter Field:=1, Criteria1:="<>"
Sheets("(12)").Select
ActiveSheet.Range("$A$1:$A$3392").AutoFilter Field:=1, Criteria1:="<>"
Sheets("(13)").Select
ActiveSheet.Range("$A$1:$A$3392").AutoFilter Field:=1, Criteria1:="<>"
Sheets("(14)").Select
ActiveSheet.Range("$A$1:$A$3392").AutoFilter Field:=1, Criteria1:="<>"
Sheets("(15)").Select
ActiveSheet.Range("$A$1:$A$3392").AutoFilter Field:=1, Criteria1:="<>"
Sheets("(16)").Select
ActiveSheet.Range("$A$1:$A$3392").AutoFilter Field:=1, Criteria1:="<>"
Sheets("(17)").Select
ActiveSheet.Range("$A$1:$A$3392").AutoFilter Field:=1, Criteria1:="<>"
Sheets("(19)").Select
ActiveSheet.Range("$A$1:$A$3392").AutoFilter Field:=1, Criteria1:="<>"
Sheets("(21)").Select
ActiveSheet.Range("$A$1:$A$3392").AutoFilter Field:=1, Criteria1:="<>"
Sheets("(23)").Select
ActiveSheet.Range("$A$1:$A$3392").AutoFilter Field:=1, Criteria1:="<>"
Sheets("(28)").Select
ActiveSheet.Range("$A$1:$A$3392").AutoFilter Field:=1, Criteria1:="<>"
Sheets("(29)").Select
ActiveSheet.Range("$A$1:$A$3392").AutoFilter Field:=1, Criteria1:="<>"
Sheets("(30)").Select
ActiveSheet.Range("$A$1:$A$3392").AutoFilter Field:=1, Criteria1:="<>"
Sheets("(31)").Select
ActiveSheet.Range("$A$1:$A$3392").AutoFilter Field:=1, Criteria1:="<>"
Sheets("(33)").Select
ActiveSheet.Range("$A$1:$A$3392").AutoFilter Field:=1, Criteria1:="<>"
Sheets("(34)").Select
ActiveSheet.Range("$A$1:$A$3392").AutoFilter Field:=1, Criteria1:="<>"
Sheets("(35)").Select
ActiveSheet.Range("$A$1:$A$3392").AutoFilter Field:=1, Criteria1:="<>"
Sheets("(36)").Select
ActiveSheet.Range("$A$1:$A$3392").AutoFilter Field:=1, Criteria1:="<>"
Sheets("(38)").Select
ActiveSheet.Range("$A$1:$A$3392").AutoFilter Field:=1, Criteria1:="<>"
Sheets("(39)").Select
ActiveSheet.Range("$A$1:$A$3392").AutoFilter Field:=1, Criteria1:="<>"
Sheets("(40)").Select
ActiveSheet.Range("$A$1:$A$3392").AutoFilter Field:=1, Criteria1:="<>"
Sheets("(51)").Select
ActiveSheet.Range("$A$1:$A$3392").AutoFilter Field:=1, Criteria1:="<>"
Sheets("(52)").Select
ActiveSheet.Range("$A$1:$A$3392").AutoFilter Field:=1, Criteria1:="<>"
Sheets("(53)").Select
ActiveSheet.Range("$A$1:$A$3392").AutoFilter Field:=1, Criteria1:="<>"
Sheets("(54)").Select
ActiveSheet.Range("$A$1:$A$3392").AutoFilter Field:=1, Criteria1:="<>"
Sheets("(55)").Select
ActiveSheet.Range("$A$1:$A$3392").AutoFilter Field:=1, Criteria1:="<>"
Sheets("(56)").Select
ActiveSheet.Range("$A$1:$A$3392").AutoFilter Field:=1, Criteria1:="<>"
Sheets("(57)").Select
ActiveSheet.Range("$A$1:$A$3392").AutoFilter Field:=1, Criteria1:="<>"
Sheets("(58)").Select
ActiveSheet.Range("$A$1:$A$3392").AutoFilter Field:=1, Criteria1:="<>"
Sheets("(59)").Select
ActiveSheet.Range("$A$1:$A$3392").AutoFilter Field:=1, Criteria1:="<>"
Sheets("(60)").Select
ActiveSheet.Range("$A$1:$A$3392").AutoFilter Field:=1, Criteria1:="<>"
Sheets("(62)").Select
ActiveSheet.Range("$A$1:$A$3392").AutoFilter Field:=1, Criteria1:="<>"
Sheets("Summary").Select
ActiveSheet.Range("$A$2:$A$118759").AutoFilter Field:=1, Criteria1:="<>"
End Sub
Last edited by a moderator: