The code I posted is the one used to solve the problem. Thanks again to Mark for his help and patience. HI