Thank you so much. I will try both of the methods and choose whichever I find easier to understand. Do you think it would be easy to alter the code if for example the two rows with values start not from the beginning but from some other cell. For example they are in the range "d4:n5" or any other similar range? If you are in nyc your beer or whatever you drink is on me :)