Bonjour,
Est-ce que quelqu'un pourrait m'expliquer ce codage VBA ? Que je puisse le modifier.
D'avance merci
Sub Complement(x As Single, y As Single)
Dim derlig As Integer, i As Integer, j As Integer
Dim nbreste As Integer, S As String
S = ""
With Sheets(Data0)
derlig = .Range("A" & Rows.Count).End(xlUp).Row
For i = 3 To derlig
If .Cells(i, "E").Value <= y Then
If .Cells(i, "C").Value <= x Then
nbreste = Int(x / .Cells(i, "C").Value)
S = S & "ou " & nbreste & " palette(s) de " & .Cells(i, "C").Value & " x " & .Cells(i, "E").Value & vbCrLf
End If
End If
Next i
End With
If S = "" Then S = "Camion Plein" Else S = "Complément possible : " & vbCrLf & vbCrLf & S
MsgBox S, , "Complément"
End Sub
Est-ce que quelqu'un pourrait m'expliquer ce codage VBA ? Que je puisse le modifier.
D'avance merci
Sub Complement(x As Single, y As Single)
Dim derlig As Integer, i As Integer, j As Integer
Dim nbreste As Integer, S As String
S = ""
With Sheets(Data0)
derlig = .Range("A" & Rows.Count).End(xlUp).Row
For i = 3 To derlig
If .Cells(i, "E").Value <= y Then
If .Cells(i, "C").Value <= x Then
nbreste = Int(x / .Cells(i, "C").Value)
S = S & "ou " & nbreste & " palette(s) de " & .Cells(i, "C").Value & " x " & .Cells(i, "E").Value & vbCrLf
End If
End If
Next i
End With
If S = "" Then S = "Camion Plein" Else S = "Complément possible : " & vbCrLf & vbCrLf & S
MsgBox S, , "Complément"
End Sub