@JBeaucaire

I tried the macro for the example in post #19 but I receive as a result 3. The correct result in the example is 4. I'll double checked the attachment and the correct result is 4. Thank you