Automatic deletion of formulae

sunil.kini

New Member
Joined
May 18, 2011
Messages
17
I want formulae in a cell to automatically delete itself if the worksheet is opened on or after acertain date.
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
You can record a macro deleting the range in question, then use the Workbook_Open event to evaluate the date.

E.G. If Date >= #1/1/2011# then Delete

Just note that there are issues with deleting any information that someone else might have entered, but if it's just formulas you should be OK.

HTH,
 
Upvote 0
Of course this will only work if macros are enabled, and they may not be. I'm not aware of any worksheet formula or function which will delete the contents of a worksheet cell.
 
Upvote 0
This code will run each time your workbook is opened:
Code:
Sub Auto_Open()
    If Date >= #5/30/2011# Then
        Range("C2:D3").Clear
    End If
End Sub
It will clear the cells in Range C2:D3 if the current Date is on or after the listed Date.
 
Upvote 0
You can try this if you want your formula to be entered as the formula's answer only.

Sub notasformula()
Range("C1").Formula = "=A1+B1"
Range("C1").Value = Range("C1").Value
End Sub

I posted this so there's no need for you to delete your formulas everyday.

Hope this helps in some way.

:) cheers!

-e.rgabrieldoronila
 
Upvote 0
Copy and Paste the entire cells as values upon opening

Sub Auto_Open()

Cells.Copy
Selection.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False

End Sub

cheers!

-e.rgabrieldoronila
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,599
Messages
6,179,828
Members
452,946
Latest member
JoseDavid

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top