Hi and welcome to the forum.
Nasty stuff first - could you read the forum rules and use code tags when posting code, please?
OK, with that out of the way, on with your problem ... I think your immediate problem can be fixed just by changing the line:
To:
As for making the code run over multiple lines - the issue with the macro recorder is that it records macros with a lot of unnecessary code in. Your whole thing can be re-written as just a couple of lines of code. Are you always writing to the same sheet in the target workbook? If so, which sheet is it?
Bookmarks