I have data with Name, Date of birth and Age as per format. I need vba code to check the age of the persons.
Need common Remarks in Column O
I am using some code but that is giving all desired results. code given at the end of this page
Criteria is
if Self OR Spouce OR Father OR Mother OR Father-in-law OR Mother-in-Law (As per Relation mentioned "in Column I) age is less than 18 years (As per age mentioned "in Column K) then need result as "Self age is less than 18 years" OR "Spouce age is less than 18 years" OR “Father age is less than 18 years” and so on in Column O against all family members of particular family code. E.g. Refer column No.O2 to O5.
if Self OR Spouce OR Father OR Mother OR Father-in-law OR Mother-in-Law (As per Relation mentioned "in Column I) age is above 80 years (As per age mentioned "in Column K) then need result as "Self age is above 80 years" OR "Spouce age is above 80 years" OR “Father age is above 80 years” and so on in Column O against all family members of particular family code. E.g. Refer column No.O24 to O25.
if any Child (Child, Child2, Child3,…. age is above 25 years (As per age mentioned "in Column K) then need result as "Child age is above 25 years "in Column O. For other child "Child2 age is above 25 years OR Child3 age is above 25 years" E.g. Refer column No.O7 to O10.
Also Need Some Logical Remarks in Column O
If age difference between Self and Spouce is more than 15 years then need result as "Self and Spouce age difference is more than 15 years "in Column O.
If age difference between Self and Child, Child2, Child3….. is less than 18 years then need result as "Self and Child age difference is less than 18 years "in Column O.
If age difference between Self and Father is less than 18 years then need result as "Self and Father age difference is less than 18 years "in Column O.
If age difference between Self and Mother is less than 18 years then need result as "Self and Mother age difference is less than 18 years "in Column O.
If age difference between Self and Father-in-law is less than 18 years then need result as "Self and Father-in-law age difference is less than 18 years "in Column O.
If age difference between Self and Mother-in-law is less than 18 years then need result as "Self and Mother-in-law age difference is less than 18 years "in Column O.
If age difference between Spouce and Child, Child2, Child3….. is less than 18 years then need result as "Spouce and Child age difference is less than 18 years "in Column O.
If age difference between Spouce and Father is less than 15 years then need result as "Spouce and Father age difference is less than 15 years "in Column O.
If age difference between Spouce and Mother is less than 15 years then need result as "Spouce and Mother age difference is less than 15 years "in Column O.
If age difference between Spouce and Father-in-law is less than 18 years then need result as "Spouce and Father-in-law age difference is less than 18 years "in Column O.
If age difference between Spouce and Mother-in-law is less than 18 years then need result as "Spouce and Mother-in-law age difference is less than 18 years "in Column O.
If any cell in Age (Column I) contains following
#NUM! Wrong Age Mentioned
#N/A Wrong Age Mentioned
#NULL! Wrong Age Mentioned
#REF! Wrong Age Mentioned
#DIV/0! Wrong Age Mentioned
##### Wrong Age Mentioned
Errors Wrong Age Mentioned
OR any kind of error Wrong Age Mentioned
please note: very important is if there is multiple remarks applicable to any family All the remarks should be there separated by “/” against all members of that particular family. For example refer cell O16 to O20 and cell O26 to O28
This is very important for me. Please help me with code.
Please Login or Register to view this content.
Bookmarks