Forum Discussion
VBA Message Box Worksheet Change
Perhaps this is what you're trying to do? I named the employee name, position/title, and primary leave cells (so vba can still find those cells if you insert/delete rows by they name instead of their cell address). If either the employee name cell changes or the primary leave cell changes, then it should test for "ceo" or "founder" and "new york paid family leave".
If you right click on the worksheet and select 'view code' then you'll see the vba procedure. Also, in the attached workbook, note I changed cell E19 to index/match as I don't have xlookup on this machine in order to test it.
- WARJAMANDFeb 05, 2022Copper ContributorThank-You....I will check out and review once I get home. I really appreciate your time in helping me with this as VBA is not one of my strengths with Excel 😀
- JMB17Feb 05, 2022Bronze Contributor
You're quite welcome. In addition to mtarler 's suggestions, I think another possible non-vba approach you could consider would be to use the filter function to filter out 'new york paid family leave' for ceos or founders so it's not even an option and use that as the data validation source for primary leave, But, you'd also have to apply data validation to the employee name so if primary leave was filled out first or left over from a previous input, it would force them to clear the primary leave field before selecting a ceo or founder.
- WARJAMANDFeb 12, 2022Copper ContributorThat is another Great Idea... Thank you again. I will look into this now.
Regards,
WARJAMAND
- mtarlerFeb 05, 2022Silver Contributorif you want, it could be a hybrid solution that uses the IF() statement with conditional formatting AND the VBA macro so that if they have macros off or view the file online, they still get a notification.
- WARJAMANDFeb 12, 2022Copper ContributorThank-you so much....I use conditional formatting on another tab. I thought I saw a YouTube video stating conditional formatting slows down Excel.
Much appreciated & thank-you again!
WARJAMAND