Excel Data Validation is an amazing feature that controls the data entered into the worksheet. At the time of entering new data, we can set any kind of condition according to our need on selected cells using Excel Data Validation. But usually, Excel Data Validation Not Working Copy Paste is a major problem in this procedure.
For more clarification, I am going to use a dataset of a company containing data of Employee Name, Department and employees who are in Waiting List.
Problem and Solution of Data Validation Not Working Copy Paste in Excel
1. Reason for Data Validation Not Working Copy Paste in Excel
In this dataset, I am going to employ the Data Validation Feature in the Employ Name column to limit my entries.
- For this, I have selected Column B which contains the Employee Name.
- Then, from the Data tab, I have selected Data Tools and finally selected Data Validation from there.
A dialogue box will appear.
- Here, the Settings tab is open in the dialogue box.
- After that, we have to select Validation criteria from Allow. Here, I have chosen Text length.
- Next, I have to limit the range for validation. Here, I have allowed the data containing text from a minimum of 1 to a maximum of 8 characters for validation.
The Data Validation feature will be applied.
Followingly, I input data that does not satisfy the condition. Here, I wrote the value Labuchange from the Waiting List.
A warning message will be shown for the invalid data entry. As I input data that is invalid according to the Data Validation condition, it did not accept the value and a warning message has appeared.
But if you copy the value and paste it in the data validated column, it will accept the value and no warning message will appear.
This is a serious problem as our Data Validation is not working on copy-paste.
Read More: How to Circle Invalid Data in Excel
2. Creating Data Validation Using VBA to Work Copy Paste
In the case of solving the Excel Data Validation Not Working for Copy Paste problem, Visual Basic for Applications (VBA) is the only solution. We are going to explain the solution here.
- First of all, select the Developer tab.
- Next, select Visual Basic.
A new window will appear.
- Click on the Sheet in which you want to apply the Code. Here, I selected Sheet2 named VBA to apply the code.
- Select the Worksheet from General and Change from Declarations to create a Private Sub.
- Now, input the following code on how you want to validate the data.
My used code is mentioned below:
Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column = 2 Then If Len(Target.Value) >= 8 Then MsgBox "Name is longer than 8. Undo!", vbCritical Application.Undo End If End If End Sub
- Then, check if the validation is working or not from the sheet.
Here, I have inserted the value from the D7 cell by copying and pasting it into B10. The value shows an Error alert according to the data validation condition. So, the warning box will appear.
This method also works perfectly if I input the data through the keyboard or any other process.
If you click OK, the cell will go back to its previous mode.
You can practice here to be an expert.
Download Practice Workbook
Excel Data Validation Not Working Copy Paste problem can have a severe impact in so many important cases. I hope you will benefit from the solution. For any further questions related to the topic, comment below.