Hi
It been a while that i have touched vba.
I am getting a compile error do without loop? But there is a do in the script. Its driving me nuts.
It been a while that i have touched vba.
I am getting a compile error do without loop? But there is a do in the script. Its driving me nuts.
VBA Code:
Sub FilterEnt_IC()
Dim WbMacro As Workbook
Dim wb As Workbook
Dim strFilename As String
Dim iRow As Integer
Dim Ent As String
Set WbMacro = ThisWorkbook
iRow = 1
Application.ScreenUpdating = False
Do Until wbMacro.Sheets("Macro").Cells(iRow, 1) = ""
'Ent = iRow
'First 171500
With wbMacro.Sheets("Data")
.AutoFilterMode = False
With .Range("A1:R1")
.AutoFilter
.AutoFilter Field:=2, Criteria1:="41100"
.AutoFilter Field:=3, Criteria1:="175100"
.AutoFilter Field:=4, Criteria1:="=0", Operator:=xlOr, Criteria2:="="
.AutoFilter Field:=17, Criteria1:="=B001", Operator:=xlOr, Criteria2:="=L009"
End With
wbMacro.Sheets("Data").AutoFilter.Range.Copy
wbMacro.Sheets("171500").Range("A" & Rows.Count).End(xlUp).Offset(1).PasteSpecial (xlPasteValues)
iRow = iRow + 1
Loop
End Sub