Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Error Message when trying to Copy Worksheet

  Asked By: Bailey    Date: Jan 12    Category: MS Office    Views: 1715
  

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.

Share: 

 

6 Answers Found

 
Answer #1    Answered By: Kawthar Malik     Answered On: Jan 12

Do any of these names exist  in the workbook? Look at Insert/Names/Define to
find them. If they point to cells on the w/s you are copying there will be an
issue.

 
Answer #2    Answered By: Komal Malik     Answered On: Jan 12

As far as I can find  using either f(5) or IND I can find none of the names
in the workbook  or the worksheet. One of the names I would never use myself
and that one is "wrn.controlled._.shipping._.orion". I have no idea where
that name would come from unless it was generated by the program  itself
somewhere. I will continue looking for the various names that show up by
looking at each worksheet  in the workbook (9 worksheets) and also looking
into the buttons and macros that are in the workbook.



Any other suggestions  on how to resolve this issue?

 
Answer #3    Answered By: Marsha Miller     Answered On: Jan 12

wrn* is a system generated name, there are a few of them.

Also, names can be hidden, so you don't see them in the built-in Name
Manager.

You should get hold of a copy  of Jan Karel Pieterse's free addin
NameManager utility http://www.jkp-ads.com/officemarketplacenm-en.asp
which will help you enormously with names.

 
Answer #4    Answered By: Judy Gray     Answered On: Jan 12

I haven't been able to duplicate the symptoms.. although I haven't spent a LOT
of time  on it.
Have you tried setting Application.DisplayAlerts = false (remember to set it to
True after you've copied the worksheet).
This MIGHT cause the popup to be disabled... it doesn't work for things like
locked cell warnings, but it might work for this.

 
Answer #5    Answered By: Bernadette Daniels     Answered On: Jan 12

What if Pat uploaded his file? I would think one of us might be able to
figure it out if we got our hands on the actual workbook...

 
Answer #6    Answered By: Cecelia Sims     Answered On: Jan 12

In the meantime I found a work around to the problem  (always more than one
way to do things). What I have done is to add a new worksheet  in the
position I wanted to copy  the old one. I then copied the data from the
original worksheet (cells.select, copy) and then used a similar command on
the new worksheet (cells.select) so I am selecting the entire worksheet. I
then use Paste special to paste all the information from the old worksheet
to the new one. I then go back  to the old worksheet and use paste
special.values to clear out all the formulas on the old worksheet.



Using this method, with several additional steps that wouldn't be needed if
the "right" method worked, I am able to do what I need.



Please look at the old file and see if you can find  what is needed so I
don't run into this problem the next time  I want to copy or move  a
worksheet. Since I found a method that works  I can at least put this
problem on the back burner and finish other problems I have.



Thanks to all for the suggestions  and help.



I did download the suggested utility for finding named ranges but need to
work with it more to understand what it is trying to tell me.

 
Didn't find what you were looking for? Find more on Error Message when trying to Copy Worksheet Or get search suggestion and latest updates.




Tagged: