Hi Chris,

Thank you very much for your reply. I have changed the first line of my code to %Macro layout(sheet). Now it works perfectly without an error message.

I and J are two variables in the Comp&i files. I wanted to drop them.

Best regards,

Simou