Excelllllllllllllllllllll
Board Regular
- Joined
- Jun 13, 2017
- Messages
- 108
Hello, I have the below code that works perfectly if you enter/copy data one cell at a time.
But I copy/paste multiple cells all the time, at which point the code below gives me an error.
Is there a way to adapt the below code to work with multiple cells changing at the same time?
<code></code>
But I copy/paste multiple cells all the time, at which point the code below gives me an error.
Is there a way to adapt the below code to work with multiple cells changing at the same time?
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim x As Integer
For x = 2 To Sheets("Delivery Schedule").Cells(Rows.Count, 3).End(xlUp).Row
If Target.Column = 3 And Target.Row = x Then
Dim z As Integer
For z = 2 To Sheets("Obsolete Codes").Cells(Rows.Count, 1).End(xlUp).Row
If Target.Value = Sheets("Obsolete Codes").Range("A" & z) Then
MsgBox "An obsolete code has been entered through the last action.", vbCritical
End If
Next z
End If
Next x
End Sub