Copying spreadsheet with formulas

  • Thread starter Thread starter Bert
  • Start date Start date
B

Bert

Hello, I would like to copy a fairly large spreadsheet retaining the
formulas but without the data which I inputted. I appreciate your help
Thanks, Bert
 
Hi Bert

This example will copy all worksheets in a new workbook and delete all constants
You can also run it on a copy of the workbook if it is active
Delete the <Worksheets.Copy> then

Sub test()
Dim sh As Worksheet
Worksheets.Copy
For Each sh In ActiveWorkbook.Sheets
On Error Resume Next
sh.Cells.SpecialCells(xlCellTypeConstants).ClearContents
On Error GoTo 0
Next sh
End Sub
 
Bert

After copying the sheet.

Edit>Go To>Special>Constants. Select what you want to find then OK.

Edit>Clear Contents.

Gord Dibben Excel MVP
 

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