Save sheet as new file w/o refs to original?

  • Thread starter Thread starter Ed
  • Start date Start date
E

Ed

Is it possible to save a sheet as a separate new file with a single command
and carry over everything EXCEPT references to the original file? I tried
it, but instead of values only I get formulas with references back to the
original workbook. Or will I need to open a new book and do a series of
Paste Specials (values, column widths, formats, etc.)?

Ed
 
Hi Ed

Try this

Sub test()
ActiveSheet.Copy
With ActiveWorkbook.Sheets(1).UsedRange
.Value = .Value
End With
End Sub
 
It isn't that hard:

Activesheet.copy
Activesheet.cells.copy
Activesheet.pasteSpecial xlValues
ActiveWorkbook.SaveAs "MyUnlinkedCopy.xls"
 
Thanks, Ron. Worked great!

Ed

Ron de Bruin said:
Hi Ed

Try this

Sub test()
ActiveSheet.Copy
With ActiveWorkbook.Sheets(1).UsedRange
.Value = .Value
End With
End Sub
 
Thanks, Tom. I had a problem, though: run-time error 1004 - "PasteSpecial
method of Worksheet failed". Help said the xlValues was only available to
the Range object, so I changed ActiveSheet to ActiveSheet.Range("A1") and it
worked okay. Is this just a difference, perhaps, in versions (I'm using
XL2000 with Win2000)? Or did I do something wrong?

Ed
 
No. Its called a typo:

Activesheet.copy
Activesheet.cells.copy
Activesheet.cells.pasteSpecial xlValues
ActiveWorkbook.SaveAs "MyUnlinkedCopy.xls"

although range("A1") would work as well.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top