Validation Not Triggering

Anonymous
2020-07-11T19:07:32+00:00

I have a date field with Validation set to dates between with a date picker UserForm.

When I select the date from the date picker and populate the cell it does not trigger the validation check.

I have unchecked the Ignore Blanks on the validation settings but it is still not triggering?

Help would be appreciated.

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes
Answer accepted by question author
  1. OssieMac 47,981 Reputation points Volunteer Moderator
    2020-07-13T06:08:27+00:00

    Unfortunately Data Validation does not work if the value is inserted with VBA code. The validation only works if the User inserts the required value in the interactive mode on the worksheet.

    Also if you copy a value and paste the value into the Data Validation cell then the validation does not work. 

    Plus if a cell is copied and pasted (ie. standard paste) then the Data Validation is actually over written and gone altogether.

    You will need to include some VBA code in an If statement to perform the validation immediately prior to the code that inserts the value. Since you are using VBA code for the process then I assume you will know how to insert the If statement to validate. However, if you need more assistance with this then please post the section of code that writes the value to the worksheet and I will assist further.

    1 person found this answer helpful.
    0 comments No comments

5 additional answers

Sort by: Most helpful
  1. Anonymous
    2020-07-14T10:34:48+00:00

    Good idea I will try that thank you.

    0 comments No comments