Sub extraire()
'Filter the 2nd and 3rd columns
ActiveSheet.Range("$A$1:$O$9950").AutoFilter Field:=2, Criteria1:="#N/A"
ActiveSheet.Range("$A$1:$O$9950").AutoFilter Field:=3, Criteria1:= _
"=Ind Eng", Operator:=xlOr, Criteria2:="=Landis"
'Create a new sheet called Sheet2
Sheets.Add.Move After:=Sheets(Sheets.Count)
Sheets(Sheets.Count).Name = "Sheet2"
'Macro for create a table in an other sheet, with the Plnd order numbers,
'and extract the TRUNKING and SM numbers in the period : Current date + 1 month - current date + 4 month
Dim tablo()
date1Mois = DateSerial(Year(Date), Month(Date) + 1, Day(Date))
date4Mois = DateSerial(Year(Date), Month(Date) + 4, 1) - 1
Sheets(2).[A1].CurrentRegion.ClearContents
For lig = 2 To Cells(Rows.Count, 9).End(xlUp).Row
If Cells(lig, 9) >= date1Mois And Cells(lig, 9) <= date4Mois And _
Left(Cells(lig, 1), 2) <> "SM" And InStr(1, Cells(lig, 4), "trunking", 1) = 0 Then
ReDim Preserve tablo(1, x)
tablo(0, x) = Cells(lig, 1)
tablo(1, x) = Cells(lig, 7)
x = x + 1
End If
Next lig
Sheets(2).[A1].Resize(x, 2) = Application.Transpose(tablo)
End Sub