Dear satputenandkumar0,

what I offered is a formula in the worksheet which I think you should be able to alter by yourself. There is no alteration of the code necessary with that formula corrected.

Ciao,
Holger