can excel automatically delete cells or rows ? can it self destruct the whole file as well ??
sorry for this question. But i believe if any genius can figure it out ?
can excel automatically delete cells or rows ? can it self destruct the whole file as well ??
sorry for this question. But i believe if any genius can figure it out ?
thanks,
Ryan
Hi ryan4646,
Excel can delete cells or rows if you tell it to such as writing a Macro to do so.
Excel doesn't self destruct unless a file is corrupted / damaged in some way.
Hth
Remember you are unique, like everyone else
Hi hth
so is that possible to assign a macro to delete rows in a specific date ? e:g : today is 22nd and i want some cells will be deleted at 24th.
Hi,
I'm noboffinme, Hth means Hope this Helps.
Yes, a Macro can delete data based on some rule you create.
Can you suggest me a macro like this ?
so the macro must delete those rows in the future, the day after tomorrow ?
That's possible with on application.ontime, but the file must be open at that moment, otherwise nothing happens or he can do it later as you reopens your file.
2 macros, the 1st in ThisWorkbook and the 2nd in module1
![]()
macro for in thisworkbook Private Sub Workbook_Open() Dim dCritical As Date dCritical = DateSerial(2013, 12, 24) + TimeValue("11:30") 'at this moment you want to delete that cell if that map is open Select Case Now - dCritical 'what is the actual moment Case Is < 0: Application.OnTime dCritical, "DeleteSomeCells" 'ciritical moment is still in the future Case 0 To 7: DeleteSomeCells 'up to 7 days after that critical moment, you still delete those cells End Select End Sub macro for in module1 Sub DeleteSomeCells() Sheets("blad1").Range("A5:D10").ClearContents '<-- blad1 is the name of the tab in which you want to delete End Sub
I can show you how to do this.
Do you have any VBA experience to write a Macro?
Can you send me a file & advise what rules the Macro should use to delete the files?
Thanks
Hi noboffinme,
i have experience to copy and paste, nothing more.
Yes, for example i want to delete the rows from A4:A106. actually if it is possible please help me to learn to put code if want to delete any cells,specially all cells,any file when i want. thanks in advance.
As long as your workbook isn't open, the macro can do nothing.
Suppose you want to autodelete some cells at 2013-12-31 11:00
* 1st possibility : workbook is opened before that moment, the macro "Workbook_Open" planned a procedure for that moment and at that moment the macro "DeleteSomeCells" 'll run.
* 2nd possibility (+dangereous situation) : up to 7 days after that moment, every time, at the moment you open that workbook, it 'll immediately run that macro "DeleteSomeCells".
In that macro I didn't delete cells, i just cleared the contents. But you have to think seriously about the dangers.
Perhaps you want that the macro only runs 1 time, so you must somewhere create a kind of flag, so that you block the macro to run a 2nd time.
Perhaps it's better that you describe good what you really want.
Hi bsalv,
i attached a file above.i want to delete those cells automatically after three days from now.
see attachment
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks