Bonjour le forum,
Dites moi, j'ai une macro qui fonctionne pas trop mal pour le moment, et j'aurai aime la rendre plus accessible.
Sur ce code, vous pouvez voir qu'un "Tri" est effectue sur une plage bien precise. Entre date 1 et date 4
Ce que j'aimerai faire, c'est pouvoir tout simplement faire apparaitre un userform au moment précis ou cette partie de la macro fonctionne, userform qui me demanderait de choisir deux dates pour mon champ d'action.
Est ce clair ? Et est ce facilement realisable ?
Merci d'avance
Dites moi, j'ai une macro qui fonctionne pas trop mal pour le moment, et j'aurai aime la rendre plus accessible.
Code:
'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
date1Mois = DateSerial(Year(Date), Month(Date) + 1, Day(Date))
date4Mois = 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
Sur ce code, vous pouvez voir qu'un "Tri" est effectue sur une plage bien precise. Entre date 1 et date 4
Ce que j'aimerai faire, c'est pouvoir tout simplement faire apparaitre un userform au moment précis ou cette partie de la macro fonctionne, userform qui me demanderait de choisir deux dates pour mon champ d'action.
Est ce clair ? Et est ce facilement realisable ?
Merci d'avance
Dernière édition: