>can anyone plese help me with a function that is not doing the proper thing
Dovi:
You have received numerous replies to the other 6 or so threads you started on this question. You should be able to take those suggestions and code and test it. If there is a new problem, then post a new specific question about what you have tried, the code example you used and what specifically the new problem is. It is not necessary to start a NEW thread regarding the same function problem you are having.
I know you are frustrated, but all those who are trying to help you are getting frustrated as well. This forum is to help resolve problems but you have to help yourself as well.
Mark McCasland
Midlothian, TX USA