copy a workbook without copying any data

  • Thread starter Thread starter Rusty
  • Start date Start date
R

Rusty

I there a way to copy a workbook without copying any data. I would like to
copy all tabs,micros,links and formulas without any data in the cells or
notes for the cells being copied.
Thank You
 
Hi Rusty,

One way:

Sub Tester()
Dim sh As Worksheet
Dim strName As String

strName = "ABCD.xls" '<<==== CHANGE

ActiveWorkbook.SaveCopyAs strName
Workbooks.Open Filename:= _
Application.DefaultFilePath & "\" & strName
For Each sh In Workbooks(strName).Worksheets
On Error Resume Next
sh.Cells.SpecialCells(xlConstants).ClearContents
sh.Cells.SpecialCells(xlCellTypeComments).Delete
On Error GoTo 0
Next
Workbooks(strName).Save
Application.DefaultFilePath
End Sub


Change ABCD to suit.
 
Thank You Norman for your reply
But that is out of my range... I am teaching myself excel and haven't got
to that level YET.
 

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