Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 48
Default Retaining formula after deleting contents.

Hi,

Is is possible to delete the contents of a cell but to retain the formula
assigned to it.

I am trying to duplicate a worksheet and have copied the existing one, but
when I try to delete the contents the formulas are also deleted.

Many thanks for your help in advance.

Simon.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Retaining formula after deleting contents.

Run this short macro on the copied worksheet:

Sub keepformulas()
For Each r In ActiveSheet.UsedRange
If r.HasFormula Then
Else
r.Clear
End If
Next
End Sub

--
Gary''s Student - gsnu200764


"SiH23" wrote:

Hi,

Is is possible to delete the contents of a cell but to retain the formula
assigned to it.

I am trying to duplicate a worksheet and have copied the existing one, but
when I try to delete the contents the formulas are also deleted.

Many thanks for your help in advance.

Simon.

  #3   Report Post  
Posted to microsoft.public.excel.misc
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default Retaining formula after deleting contents.

Deleting the values in the cells that cause the formula to return a result
other than blank, would result in the formula being in the cell, but
invisible, or zero, or whatever default value the formula concluded.

Vaya con Dios,
Chuck, CABGx3



"SiH23" wrote:

Hi,

Is is possible to delete the contents of a cell but to retain the formula
assigned to it.

I am trying to duplicate a worksheet and have copied the existing one, but
when I try to delete the contents the formulas are also deleted.

Many thanks for your help in advance.

Simon.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Retaining formula after deleting contents.

F5SpecialConstantsOK

EditDelete


Gord Dibben MS Excel MVP

On Mon, 7 Jan 2008 06:24:03 -0800, SiH23
wrote:

Hi,

Is is possible to delete the contents of a cell but to retain the formula
assigned to it.

I am trying to duplicate a worksheet and have copied the existing one, but
when I try to delete the contents the formulas are also deleted.

Many thanks for your help in advance.

Simon.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
alert before deleting contents of a cell Mortgage Man Excel Discussion (Misc queries) 3 December 15th 06 04:30 PM
Deleting a worksheet but retaining values from the worksheet. [email protected] Excel Discussion (Misc queries) 1 September 13th 06 03:00 PM
Deleting a worksheet but retaining values from the worksheet. [email protected] Excel Discussion (Misc queries) 1 September 13th 06 02:48 PM
Retaining formula T De Villiers Excel Worksheet Functions 3 June 22nd 06 11:21 AM
deleting/retaining duplicates jkrake Excel Discussion (Misc queries) 0 December 6th 05 05:21 PM


All times are GMT +1. The time now is 01:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"