Hi Sam,

Thanks for your help. Now the code is working as per my requirement.