ashleywanless
Board Regular
- Joined
- Aug 4, 2009
- Messages
- 158
I have some code which i use to export a sheet to a new workbook, its a summary reporting sheet. It works fine but im wondering if i can improve this.
At the moment the issue is the code has to reference the new workbook to copy the data (fields have more than 255 characters). Excel adds 1 to each new workbook that opens so i can only copy the sheet once before i get a debug as the second time the new worksheet is in Book2.
Is it possible to get around this by restructuring the code to not reference the new book? I'm thinking this could be done by using the string function to refer to the book as a variable? Any help would be great.
At the moment the issue is the code has to reference the new workbook to copy the data (fields have more than 255 characters). Excel adds 1 to each new workbook that opens so i can only copy the sheet once before i get a debug as the second time the new worksheet is in Book2.
Is it possible to get around this by restructuring the code to not reference the new book? I'm thinking this could be done by using the string function to refer to the book as a variable? Any help would be great.