troubleshooting Question

VB Change by val not working as expected

Avatar of Diane Lonergan
Diane LonerganFlag for United Kingdom of Great Britain and Northern Ireland asked on
VB Script
8 Comments1 Solution105 ViewsLast Modified:
I want to take some action if any of three changes occur in an excel spreadsheet. I have written some vb code, examples attached. If the first condition which is a change to staff number is made, the code works fine. If the 3rd  condition where the absence type changes, it also works fine. No matter what I do with the 2nd condition it does not work. I have tried recoding with what elseif's, I thought maybe because the column is a calculated field it didn't like it, so tried it instead on one of the date columns. I have even moved the conditions around. But no matter what I do only the absence type or the staff no changes will behave as I expect. I have attached the workbook and the troublesome code. In the workbook what should happen is that when a new absence is entered on the absence sheet, then the number of sick days for that employee should be recalculated on the PR sheet. If the row has been entered a with an incorrect date or an incorrect absence type the change should prompt a  recount of the total number of sick days for the employee.
sample-for-EE.xlsm
code-snippet.JPG
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 8 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros