Hello all - I have a simple sub that creates a new sheet, then loops through all the remaining sheets to copy its data and paste it to the new sheet. For some reason, however, it never copies the last sheet. My code:
I have tried using a variable counter, i.e. - For i = 1 to ActiveWorkbooks.Worksheets.Count - and I get the same results, it copies/pastes all but the last sheet.
This happens no matter how many sheets I try to copy. What's more, if I add one to the counter, i.e. - For i = 1 to ActiveWorkbooks.Worksheets.Count + 1 - it throws a "subscript out of range" error, yet it manages to copy all the sheets as needed. I can add an error handler to ignore the error, but I'd rather not leave it that way.
I know the loop is reaching all the sheets, but I cannot for the life of me figure out why it will not copy/paste that last sheet. What am I missing? Any ideas?
Thanks - jfp
Bookmarks