I have a workbook that i have used many times and am now running into
a problem when I try to copy a worksheet back into the same document
with a new name. I have two different situations that develop, but
the problem is the same in both instances.
I take a worksheet from the workbook and select "copy a worksheet"
and I place it ahead of the current worksheet. In some versions of
the program it works perfectly the first time and then fails if i
have to do the same thing again. In other instances it won't work
the first time either.
The error I get when trying to copy the worksheet is a message as
follows (revised slightly to save space): "A formula or sheet you
want to move contains the name "temp1", which already exists on the
destination worksheet. Do you want to use this version for the
name? -To use as is click yes. - To rename the range click no and
enter new name."
I have checked the worksheet to see if the name exists on the
worksheet and I cannot find it there. The error shows many different
names, about 7 of them, and none exist on the worksheet.
Any suggestions as to what to do?
I am using Excel 2002 and Windows XP.
The code I am using is as follows:
Sheets(4).Select
Sheets(4).Copy Before:=Sheets(4)
Sheets(4).Select
Needless to say it never gets beyond the second line.