1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
| Sub toprovidebefore_Cliquer()
Dim NoM As Date
Dim i As Integer
Dim LastLig As Integer
Dim Active As String
On Error GoTo Errorhandler
NoM = CDate(InputBox("Documents to provide before (DD/MM/YY) : ", "Before DD/MM/YY"))
Active = ActiveSheet.Name
Sheets(Active).Select
MsgBox (Active)
Range("C2").Value = "To provide before" (X)
Range("C2").Font.Bold = True (X)
Range("C2").Font.ColorIndex = 2 (X)
Range("F2").Value = NoM (X)
Application.ScreenUpdating = False
LastLig = Range("A" & Rows.Count).End(xlUp).Row
MsgBox (ActiveSheet.Name)
MsgBox (LastLig)
For i = 4 To LastLig (X)
If Range("F" & i) < Range("F2") Then
Range("J" & i) = "x"
Else
Range("J" & i) = "xxx"
End If
Next
With Worksheets(Active)
.AutoFilterMode = False
.Range("A3:J" & LastLig).AutoFilter Field:=7, Criteria1:=""
.Range("A3:J" & LastLig).AutoFilter Field:=10, Criteria1:="x"
Application.ScreenUpdating = True
End With
Exit Sub
Errorhandler:
End Sub |
Partager