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
|
Sub Test()
Dim I As Integer, DerniereColonne As Integer, NbCVides As Integer
With ActiveSheet
DerniereColonne = .UsedRange.SpecialCells(xlCellTypeLastCell).Column
.Columns(3).Interior.Color = xlNone
NbCVides = 0
For I = 1 To 500
If .Cells(I, 2) <> "" And .Cells(I, 5) & .Cells(I, 7) & .Cells(I, 14) & .Cells(I, 17) = "" Then
If .Cells(I, 3) = "" Then
.Cells(I, 3).Interior.Color = RGB(255, 255, 0)
NbCVides = NbCVides + 1
End If
End If
Next I
If NbCVides > 0 Then
.Range(.Cells(1, 1), .Cells(500, DerniereColonne)).AutoFilter Field:=3, Criteria1:=RGB(255, 255, 0), Operator:=xlFilterCellColor
MsgBox "Veuillez remplir colonnes suivantes: Région,Raison,Type manquement,Intervalle2", vbCritical
Exit Sub
Else
courriel
End If
End With
End Sub |
Partager