View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Dr. Dirk Dr. Dirk is offline
external usenet poster
 
Posts: 1
Default Clearing content from a cell (or a group) but retain its formula

A cell contains a formula that produces a text when a condition is met (i.e.
produces "Played" if another cell contains a "yes").

How do I clear the content of a cell (or group of cells) that contains a
formula WITHOUT destroying (NOT removing) the formula of the cell?

A previous recommendation was to install the following macro:

Sub ClearAllSaveFormulas()
Dim cell As Range
For Each cell In Selection
With cell
If Not .HasFormula Then
.ClearContents
End If
End With
Next
End Sub

However, if the cell contains a formula, the above macro will not clear the
content of the cell.

In advance, thank you for your time and help

Dirk