Remove "Ghost" Programming From Previous Format

  • Thread starter Thread starter Karl Burrows
  • Start date Start date
K

Karl Burrows

Hi!

I have a workbook that was created in Lotus 123 and may have even been
originally created in Quattro. My problem is we need to copy worksheets in
the file to other tabs and other workbooks. Everytime I try to copy or
move, I get the following message:

"A formula or sheet you want to move or copy contains the name "newrr",
which already exists on the destination worksheet"

I have checked for VBA, defined names and ranges and checked all cells for
references and nothing comes up. How can I remove these 'ghosts'?

Thanks!
 
Hi Carl


Open the Workbook. Push Alt+F11 and go to Insert>Module. Paste is the
simple code below:

Sub GoAwayNames()
Dim nName As Names
For Each nName In Names: nName.Delete: Next
End Sub

Place your mouse insertion point anywhere within the code and push F5

***** Posted via: http://www.ozgrid.com
Excel Templates, Training & Add-ins.
Free Excel Forum http://www.ozgrid.com/forum *****
 
I tried it and got a debug error: type mismatch

Any thoughts to modify to work?

Thanks!
 
Hi Karl

Sounds like format issue due to copying.

Try retyping this exactly as shown

Sub GoAwayNames()
Dim nName As Names
For Each nName In Names
nName.Delete
Next nName
End Sub

Slightly different the the other one, you may be able to to do a copy
and paste.

If still now good, drop me an email and I will send you a working
example.


***** Posted via: http://www.ozgrid.com
Excel Templates, Training & Add-ins.
Free Excel Forum http://www.ozgrid.com/forum *****
 
Oops! Just noticed I had

Dim nName As Names

and not

Dim nName As Name

as it should be (singular for Name)

Having said this, it shouldn't cause any debugs, at least not on my
Excel version, XP.

Even *if* there are no names in the Workbook, it should never enter the
loop!



***** Posted via: http://www.ozgrid.com
Excel Templates, Training & Add-ins.
Free Excel Forum http://www.ozgrid.com/forum *****
 
424 Object Required

Here's what I typed in:

Sub GoAwayName()
Dim nName As Name
For Each nName In Name
nName.Delete
Next nName
End Sub

Not sure why it keeps stopping...
 
Excellent! Cleared it right up. So simple, yet I am so stupid!!

I have picked up a few VBA books. If I can ever find the time...
 
Back
Top