delete values in several cells without deleting the formulas

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I wanted to clear the values in a spreadsheet without deleting the formulas
or formatting in the spreadsheet. For example: A budget sheet made for every
year, the formulas and formatting remains the same, only the values change.
I tried paste special formulas....in this case, if values are present, they
get copied too.
 
Hi
you can't delete the 'values' from a formula. The formula will always
calculate its result
 
Hi dranreb

Make a copy of the worksheet
F5>Special
Constants
OK
Delete the selection now
 
You can also delete the values via code if needed:

Sub DeleteNumbers()
On Error Resume Next
Cells.SpecialCells(xlCellTypeConstants, xlNumbers).ClearContents
End Sub

Be careful with this. Since dates are stored as numbers, it will delete
them too.
 
If you're careful with your selection, you can clear the constants.

But make sure you avoid (don't select) headers/descriptions/instructions that
you want to keep.

You can select a range, ctrl-click select another range, etc to avoid the
constants that should be kept.
 

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