bottom
Great ExcelTips!
         
Your e-mail address is safe!
Close Note

Tips.Net > ExcelTips Home > Editing > Deleting > Deleting All Your Formulas

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:

  1. Press F5. Excel displays the Go To dialog box.
  2. Click Special. Excel displays the Go To Special dialog box. (Click here to see a related figure.)
  3. Make sure the Constants radio button is selected.
  4. Click OK. All the cells containing constants (everything except formulas) are selected.
  5. Press the Del key.

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!

Helpful Links

Ask an Excel Question
Make a Comment

Tips.Net Home
Vital News Home

ExcelTips FAQ
ExcelTips Premium

Learn Access Now

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

 

Great Info!

Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your e-mail address and click "Subscribe."
     
(Your e-mail address will never be shared with anyone, ever.)