A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
UniqueFunction should hold a list of Unique functions from your database (column E)
the code is looping through this list and adding blank worksheets for each one. As it does that, it attempts to name the sheet using the name of the function. So if you are getting an error, the value of UniqueFunction(c) is not a valid sheet name. This is a data problem. So you would have to check what the values are .
you could add a line
msgbox c & ": ->" & uniqueFunction(c) & "<-"
destSh.Name = UniqueFunction(c)
Then you can see what it is trying to name the sheet (even detect if UniqueFunction(c) is empty).
--
Regards,
Tom Ogilvy