
Tips.Net > ExcelTips Home > Editing > Deleting > Deleting All Your Formulas
Summary: As the new year rolled around, you might have been faced with the task of making copies of your last-year workbooks to use for the new year. If this is the case, you might want to delete all the contents of those workbooks that don’t contain formulas. This tip introduces a few techniques you can use to accomplish the task. (This tip works with Microsoft Excel 97, Excel 2000, Excel 2002, Excel 2003, and Excel 2007.)
At the beginning of each year Richard makes a copy of the previous year's Excel workbook. To get ready for the new year's data, he then needs to delete everything in the copy except for formulas. Richard wonders if there is a quick way to do this.
Actually, there is a very quick way to manually delete all the non-formula information in a worksheet. Follow these steps:
If you have a lot of worksheets in a workbook and you want to delete all the constants from each of the worksheets, you might want to use a macro that automates the above steps for the entire workbook.
Sub DelAllConstants()
Dim wks As Worksheet
Dim rng As Range
For Each wks In ThisWorkbook.Worksheets
On Error Resume Next
Set rng = wks.Cells.SpecialCells(xlCellTypeConstants, 23)
On Error GoTo 0
If Not rng Is Nothing Then
rng.ClearContents
End If
Set rng = Nothing
Next
Set wks = Nothing
End Sub
Tip #3308 applies to Microsoft Excel versions: 97 2000 2002 2003 2007
Tame Your Data! ExcelTips: Filters and Filtering provides all the details necessary to let you manage large sets of data with confidence and ease. Its information-packed pages demonstrate how to use the two types of filters provided by Excel: AutoFilters and advanced filters.
Check out ExcelTips: Filters and Filtering today!
Want to make Excel do even more? The way is easy when you know how to use macros. This great e-book makes it easy. (more information...)
Ask an Excel Question
Make a Comment
ExcelTips FAQ
ExcelTips Premium
Beauty Tips
Bugs and Pests Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Money Tips
Organizing Tips
Pet Tips
Word2007 Tips
WordTips
Advertise on the
ExcelTips Site