Thank you!!!!!!! It worked like a charm. Before posting i was planning to convert $iSheet to numeric and then test it out but thought that might not be the problem. Turns out that was the problem.
Thank you very much for prompt reply. It made my day.