Hi Norie

I tried what you suggested but I get the error:

RunTime Error 1004

Unable to get the CountA property of the WorksheetFunction Class
then it highlights this part of the code in yellow:

emptyRow = WorksheetFunction.CountA(xlw.Sheets("Data").Range("A:A")) + 1
Any ideas?

Many thanks