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
| Sub formulaire_rempli()
Dim cel As Range, Plg As Range
Dim i As Integer, Dl As Long, c()
With Sheets("Feuil1")
i = 0
Dl = .Range("A" & .Rows.Count).End(xlUp).Row
Set Plg = .Range("A2:A" & Dl)
For Each cel In Plg
If WorksheetFunction.CountA(.Range(cel(1, 2).Address, cel(1, 3).Address)) = 0 Then
MsgBox "Le formulaire est incomplet"
ElseIf cel(1, 3) <> "" Then
i = i + 1
ReDim c(1 To i)
c(i) = cel(1, 4).Value
MsgBox c(i)
End If
Next cel
End With
Set Plg = Nothing
With Sheets("Feuil2")
Dl = .Range("A" & .Rows.Count).End(xlUp).Row
Set Plg = .Range("A2:A" & Dl)
For Each cel In Plg
For i = 1 To UBound(c)
If cel = c(i) Then
With .Rows(cel.Row).Interior
.Pattern = xlSolid
.ThemeColor = xlThemeColorDark1
.TintAndShade = -0.14996795556505
End With
End If
Next i
Next cel
End With
Set Plg = Nothing
End Sub |
Partager