Quote Originally Posted by john3j View Post
Here is my code:
Remove:
shtName = ActiveSheet.Name

Change the remaining instance of
ActiveSheet.Name
to:
ActiveWorkbook.Worksheets(I).Name

OK, a little tidying up required like removing the leading semicolon which I'll leave to you.