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
| Ref1 = ActiveCell.Offset(0, -3) 'ligne H
Ref2 = ActiveCell.Offset(0, -5) 'ligne F
Ref3 = ActiveCell.Offset(0, -8) 'ligne C
Ref4 = ActiveCell.Offset(0, -10) 'ligne A
With Sheets("exemple")
For i = 7 To [K10000].End(xlUp).Row
If OptionButton1 = True Then
If Cells(i, "H") = Ref1 And Cells(i, "F") = Ref2 And Cells(i, "A") = Ref4 Then
If Me.ComboBox1 = "POSITIF" Then
.Range("O" & ActiveCell.Row & ":R" & ActiveCell.Row).Copy Destination:=Range("O" & i)
.Range("L" & ActiveCell.Row).Copy Destination:=Range("L" & i)
.Range("G" & i).Copy Destination:=Range("N" & i)
Else
.Range("O" & ActiveCell.Row & ":R" & ActiveCell.Row).Copy Destination:=Range("O" & i)
.Range("L" & ActiveCell.Row).Copy Destination:=Range("L" & i)
.Range("G" & i).Copy Destination:=Range("N" & i)
Range("N" & i).Select
Selection = Range("N" & i) * 0
End If
End If
End If
If OptionButton2 = True Then
If Cells(i, "H") = Ref1 And Cells(i, "F") = Ref2 And Cells(i, "A") = Ref4 And Cells(i, "C") = Ref3 Then
If Me.ComboBox1 = "POSITIF" Then
.Range("O" & ActiveCell.Row & ":R" & ActiveCell.Row).Copy Destination:=Range("O" & i)
.Range("L" & ActiveCell.Row).Copy Destination:=Range("L" & i)
.Range("G" & i).Copy Destination:=Range("N" & i)
Else
.Range("O" & ActiveCell.Row & ":R" & ActiveCell.Row).Copy Destination:=Range("O" & i)
.Range("L" & ActiveCell.Row).Copy Destination:=Range("L" & i)
.Range("G" & i).Copy Destination:=Range("N" & i)
Range("N" & i).Select
Selection = Range("N" & i) * 0
End If
End If
End If
Next i
End With |
Partager