Sanjay, Thank you for this very useful code. I will be able to apply this to much of the work…