I neither have the time nor inclination to create a test file for this so the below is untested, next time please provide a sample file as requested.
Public Sub FilterData()
Dim rngArea As Range, xlCalc As XlCalculation
On Error GoTo Handler
With Application
xlCalc = Application.Calculation
.Calculation = xlCalculationManual
.Application.ScreenUpdating = False
.EnableEvents = False
End With
Sheets("sheet2").Columns(1).Clear
Sheets("Sheet1").Select
With Range(Cells(1, Columns.Count), Cells(Rows.Count, "A").End(xlUp).Offset(, Columns.Count - 1))
.FormulaR1C1 = "=IF(OR(RC2=0,RC3=0.2,RC3=-0.1),1,""x"")"
For Each rngArea In .SpecialCells(xlCellTypeFormulas, xlNumbers).Areas
Sheets("Sheet2").Cells(Rows.Count, "A").End(xlUp).Offset(1).Resize(rngArea.Rows.Count).Value = rngArea.Offset(, 1 - Columns.Count).Value
Next rngArea
.Clear
End With
ExitPoint:
With Application
.Calculation = xlCalc
.Application.ScreenUpdating = True
.EnableEvents = True
End With
Exit Sub
Handler:
MsgBox "Error etc...", vbCritical, "Error"
Resume ExitPoint
End Sub
Bookmarks