Thread
:
Clearing content from a cell (or a group) but retain its formula
View Single Post
#
2
Posted to microsoft.public.excel.misc
Gord Dibben
external usenet poster
Posts: 22,906
Clearing content from a cell (or a group) but retain its formula
Works for me.
Same as G5SpecialConstantsOKDelete.
What "contents" do not get cleared?
The cells with formulas may return errors or true or false.
Do you wish to see nothing in the cells with formulas after clearing
contents from precedent cells?
You must trap for that in your formulas.
Post some examples of your formulas.
Gord Dibben MS Excel MVP
On Tue, 19 Jan 2010 13:59:01 -0800, Dr. Dirk <Dr.
wrote:
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
Reply With Quote
Gord Dibben
View Public Profile
Find all posts by Gord Dibben