I suggest you post a sample workbook with some typical data.

The way you have coded it looks OK, at least at first glance.