Hi Fakhfour,
The user defined function changes things a little. From what I know, you can't copy the sheet to a new workbook without generating that "#NAME" issue as the new worksheet does not have that user defined function. So, to work around this, I created a third sheet in your workbook labeled "Export". This allowed me to do a copy/paste special values from your 'Report' sheet and do the exporting from the new 'Export' sheet in order to avoid having the user defined function.
I assume the file we're working on here is a sample file, so I also included code to copy not only that data from 'Report', but the formats as well. Just in case your working file had formats you wanted to retain on your final exported report.
The code is below, and I've uploaded the updated file here. Let me know if this works for you!
Zarley
Bookmarks