View Full Version : [SLEEPER:] Need assistance to calculate each name based on DATE
Omran
07-10-2024, 11:57 AM
Hi experts,
I have macro calculates in column D for EMPLOYEES sheet based on matching name in column C with TT sheet . so what I want if the lastrows don't contain DATE for specific name , then should not calculate for the name . juts running the original code for any name in EMPLOYEES sheet based on DATE in column A in TT sheet for the same name .
the amounts will change in column D for EMPLOYEES sheet based on DATE in column A for TT sheet after matching for each name .
don't change amount for any name in EMPLOYEES sheet if it doesn't contain DATE in TT sheet as in ALI MAHMUD OMAR.
see the cells are highlighted by red in last sheet how should change in EMPLOYEES sheet .
I hope find help here.
thanks
Aussiebear
07-10-2024, 12:23 PM
welcome to VBAX Omran. Your request seems a little muddled. Ali Mahmud Omar has a date in worksheet TT. Are you looking for something that every time you make a complete entry in worksheet "TT" that it adjusts the value for that person in Sheet "Employees"?
Omran
07-10-2024, 02:21 PM
Hi,
sorry I edited file by add date today for AHMED OMAR ALI,OMAR ALI OMAR
so will change the amounts in column D in EMPLOYEES sheet based on DATE for just AHMED OMAR ALI,OMAR ALI OMAR names and ignore dates 11/02/2023,12/02/2023 for names OMAR ALI OMAR,ALI MAHMUD OMAR because they don't contain DATE.
so when calculate in column D in EMPLOYEES sheet after match name with TT sheet should be based on DATE today, but the original code will do that for any date , I don't want that this will repeat calculation and gives wrong amounts because I have ever calculated .
in other meaning should match name between tow sheets and search for DATE for the name in TT sheet , then should calculate otherwise ignore the others amounts for the others name or repeated name in TT sheet don't contain DATE .
if you don't understand what code does it I will inform you.
I hope this help
Aussiebear
07-10-2024, 03:42 PM
You edited your file at your end but not the file that we are looking at? So here's my guess at what i think you are looking for.
You are wanting to determine if the latest date for each person listed in worksheet "TT", is later than that listed for each person in worksheet "Employees" then if it is, process the value in Sheet Employees by the relevant value for the person in worksheet "TT"? Can you confirm this?
Please attach your updated sample workbook
Omran
07-10-2024, 11:44 PM
almost yes but I think you mean matching the latest date should compare for column A between two sheets,right?
if it's so I don't mean that ?
I just want to match the same name between two sheets and search the latest date in column A for TT sheet without see to the latest date to EMPLOYEES sheet because will be the same old date without changing . but your thinking is not problem for me you can depend on your way . I don't think causing problem.
I'm not sure what you want to I post new result in file as you asked !:think:
Aussiebear
07-11-2024, 12:04 AM
No. I mean you match the person and find the latest date. Then if the date is later than the one existing on the Employee sheet, you then update the value.
Omran
07-11-2024, 12:55 AM
latest date means DATE (TODAY) ,right?
that what I meant.
I think what you ask in post 6 is similar like what I ask in post 5
sorry my amain language is not english !
to I answer you for post 6 yes I accept your way
thanks for your time.
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.