1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 8 Then
Select Case UCase(Target.Value)
Case "A"
With Range(Cells(Target.Row, 1), Cells(Target.Row, 7))
.Copy Sheets("Accepter").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
.Interior.Color = vbGreen
End With
Target.Value = "A"
Case "R"
With Range(Cells(Target.Row, 1), Cells(Target.Row, 7))
.Copy Sheets("Refuser").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
.Interior.Color = vbRed
End With
Target.Value = "R"
Case Else
Target.ClearContents
End Select
End If
End Sub |
Partager