Click here to Skip to main content
15,894,017 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to apply date validation on a particular cell 'F1' whose month should be the month of another cell 'E1' but the date may vary.


How to achieve this



e.g

E1 : 06/31/2013


f1 : 06/25/2015




guide me to achieve this
Posted

If you want to do it using Excel validation, please, refer below links:
Apply data validation to cells[^]
Description and examples of data validation in Excel[^]
Validation formula should be similar to the below formula.

Another way is to add formula into G column:
=IF(VALUE(E2)=MONTH(F2),"OK","Wrong date format!")

At least, you can achieve that using Worksheet events (VBA):
Worksheet.Calculate Event (Excel)[^]
or
Worksheet.Change Event (Excel)[^]
 
Share this answer
 
Comments
ridoy 8-Jun-13 6:58am    
+5 from me for analyzing it well..:)
Maciej Los 9-Jun-13 15:39pm    
Thank you, Ridoy ;)
 
Share this answer
 
Comments
Maciej Los 8-Jun-13 5:46am    
Ridoy, it's interesting collection of links, but i'm affraid that OP wants to do it direct in Excel application (no C#, no VBA, etc). Of course, i'm not 100% sure ;)
See my answer.
ridoy 8-Jun-13 6:56am    
While giving answer i also think so,you are right may be..:)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900