Welcome to VBAX njadvani. I have taken the opportunity to wrap your submitted code with tags, and removed Code sections where there was no code provided between Private Sub & End Sub as they provided no function to your submitted code. I have also edited your title so that it reflects what I believe your intent was name in requesting assistance to debug your code. I trust you don't mind.

When you ask for assistance in debugging your code are you asking for assistance to understand your code or as in "debugging" a feature that already exists within the Developer platform?