'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 - end of third next month
date1 = DateSerial(Year(Date), Month(Date) + 1, Day(Date))
date2 = DateSerial(Year(Date), Month(Date) + 4, Day(Date))
Sheets(2).[A1].CurrentRegion.ClearContents
derlig = Cells(Rows.Count, 9).End(xlUp).Row
For Each c In Range("I2:I" & derlig).SpecialCells(xlCellTypeVisible)
If c < date1Mois Then
ReDim Preserve tablo(3, x)
tablo(0, x) = Cells(c.Row, 1)
tablo(1, x) = Cells(c.Row, 4)
tablo(2, x) = Cells(c.Row, 7)
tablo(3, x) = Cells(c.Row, 9)
x = x + 1
End If
If c >= date1Mois And c <= date4Mois And _
Left(Cells(c.Row, 1), 2) <> "SM" And InStr(1, Cells(c.Row, 4), "trunking", 1) = 0 Then
ReDim Preserve tablo(3, x)
tablo(0, x) = Cells(c.Row, 1)
tablo(1, x) = Cells(c.Row, 4)
tablo(2, x) = Cells(c.Row, 7)
tablo(3, x) = Cells(c.Row, 9)
x = x + 1
End If