Hello AK :
I'm thinking your problems start with your codes lines ..
You cannot set WS to the sheet named "search" because the sheet is "Search" (i.e. upper case "S").
But your "On Error" allows you to proceed even though no sheet has been set to "WS".