How to auto delete cells every day

airingersoll

New Member
Joined
Sep 8, 2019
Messages
5
So I'm trying to create a leave/vacation tracker for my employees/coworkers, and I want to automate the worksheet so it automatically deletes(and shifts) certain cells every day. This is so the tracker remains up to date without anyone having to physical delete the cells themselves.

There is a forum on this site that explains how to do it, but I could never get it to work. Only thing I could figure out is how to auto-delete content and not the entire cell itself.

This is what I used.

Private Sub workbook_Open()
If Sheets("Aux").Range("A1").Value < Date Then
Sheets("LEAVE TRACKER").Range("D3:D34").Delete
End If
Sheets("Aux").Range("A1").Value = Date
End Sub


Any help would be greatly appreciated.
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
You have provided code that we don't know if it works or not. You have not indicated what you actually want to happen. We can guess, but it would be better, if you just told us specifically what you would like to happen. In this manner, we can either amend your code if necessary or provide you with new code. Help us to help you. We cannot read your mind or see your workbook to understand your needs.
 
Upvote 0
All I’m trying to do is auto delete this range of cells (D3:D34) at the start of every day. That’s pretty much it.
 
Upvote 0
Maybe
Code:
Private Sub Workbook_Open()
    If Sheets("Aux").Range("A1").Value < Date Then
        Sheets("LEAVE TRACKER").Range("D3:D34").[COLOR=#ff0000]EntireRow[/COLOR].Delete
    End If
    Sheets("Aux").Range("A1").Value = Date
End Sub
 
Upvote 0
You have provided code that we don't know if it works or not. You have not indicated what you actually want to happen. We can guess, but it would be better, if you just told us specifically what you would like to happen. In this manner, we can either amend your code if necessary or provide you with new code. Help us to help you. We cannot read your mind or see your workbook to understand your needs.


This is what I'm talking about. All I want to do is remove those cells (inside the red lines) at the beginning of each day.




Thank you for the help!
tYbDTSXh

tYbDTSXh
 
Upvote 0
Code:
Private Sub Workbook_Open()
    If Sheets("Aux").Range("A1").Value < Date Then
        Sheets("LEAVE TRACKER").Range("D3").[COLOR=#ff0000]EntireColumn[/COLOR].Delete
    End If
    Sheets("Aux").Range("A1").Value = Date
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,917
Members
452,366
Latest member
TePunaBloke

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