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
| Option Explicit
'Creation Alerte
Sub Recherche_stock_mini_dépassé()
Dim rCellDest As Range
Dim rCellOri As Range
Dim rRange As Range
Dim Stock_dispopp As Integer
Dim Stock_minipp As Integer
Dim wksMaga As Worksheet
Dim wksAlerte As Worksheet
Set wksMaga = Sheets("MagasinT")
Set wksAlerte = Sheets("Alerte stock")
If IsEmpty(wksAlerte.[A3]) Then
Set rCellDest = wksAlerte.[A3]
Else
Set rCellDest = wksAlerte.[A3].End(xlDown).Offset(1, 0)
End If
Set rRange = Range(wksMaga.[A3], wksMaga.[A3].End(xlDown))
For Each rCellOri In rRange
If rCellOri.Offset(0, 2).Value <= rCellOri.Offset(0, 3).Value Then
rCellDest = rCellOri
Set rCellDest = rCellDest.Offset(1, 0)
End If
Next rCellOri
Sheets("Interface").Activate
End Sub |
Partager