Re: Parse Report - iLoop does not filter report correctly
Hi
I have been doing some more work on my code and now have it filtering close.
It picks up the loop and the "aaaa". How can I get it to pick up all the different a's in criteria2?
Thanks Lee
I am slowly progressing in teach yourself VBA 
Option Explicit
Sub ParseReport()
'Dim Itm As Long, vCol As Long, m As Long
Dim ws As Worksheet, newName As String, SvPath As String
Dim Sourcewb As Workbook, Destwb As Workbook, MyArr As Variant
Dim FileExtStr As String, FileFormatNum As Long
Dim iLoop As Integer, SCH As Variant
'Set Sourcewb = ActiveWorkbook
Set ws = Sheets("Master") 'Sheet with data in it
SvPath = "C:\Documents and Settings\l7b\My Documents\Lee Trial Reports\KPI Test\" 'output directory
Application.ScreenUpdating = False
Application.EnableEvents = False
Application.DisplayAlerts = False
'Filters report by scorecard holder
SCH = Array("Finance", "Capital Risk", "GIP", "Enabling", "GIP Team", "ICT", "IT", "Financial Services", "GIP", _
"Legal", "IBM", "Communications Team", "Benefits Management", "Viability", "Health Partnerships", "Member Relations", "BSD", _
"Projects & Systems", "Distribution", "Corporate health", "Contact Centre", "Branch Network", "Member Support", _
"HG", "GMF health", "People & Performance", "Human Resources", "Group Loss Prevention & Awareness", "Group", "HBF Group", "Program Office")
'How many in SCH to loop through
For iLoop = 1 To 31
Set Sourcewb = ActiveWorkbook
Call UnHide
Call UnGroup
Call UnFilter
'Call UnMerge
ws.Range("$B$8:$BM$572").AutoFilter Field:=3, Criteria1:=SCH(iLoop), Operator:=xlOr, Criteria2:=Array("a" _
, "aa", "aaa", "aaaa"), Operator:=xlFilterValues
'Copies to new Workbook
Range("$B$1:$BM$600").Select
Selection.Copy
Workbooks.Add
ActiveSheet.Paste
Set Destwb = ActiveWorkbook
MyArr = Range("L1").Value
Call SetMyArr
Call Formatting
Call Quarters
Call Merge
'With Destwb
Call SaveNewWorkbook
'End With
Next iLoop
Application.ScreenUpdating = True
Application.EnableEvents = True
Application.DisplayAlerts = True
End Sub
Display More