Thank you so much for the quick help.
Tried it out, along with many other suggestions posted in the forums.
And after many failed trials, one solution which worked was :
“To move the
for loop out of the
if condition” - which was suggested by @mrfabulous1
Also, to my surprise , after doing so not only does the new code work fine, but the previous code (which I posted y’day) works fine too.
Makes me go crazy, as to what made it not work in the 1st place y’day!!
Anyways, thanx again mate!!