VBA to wipe an entire workbook on date

Herpe_derp

New Member
Joined
Jun 21, 2023
Messages
9
Office Version
  1. 365
Platform
  1. Windows
Hello

New to this forum.

Due to the legal need to delete data after 6 years, I need VBA code to do the following:

- on X date
- wipe all data from workbook, including all the sheets
- delete version history (so it can’t be recovered)
- if possible, replace with a message “data deleted - retention period exceeded”.

If not possible to delete version history so it’s unrecoverable, some VBA code which:

- on x date
- converts all data on all sheets into something unreadable, just random data or something like “broanfjsoieiutjwnxk”

The second way, if a version history is recovered, the VBA will just do the same over and over as it’s based on x date.

The reason I need it to do the above is because we need the file name to remain in the folder as a record.

Hope I’ve explained ok?
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Why not just over-write the files with a blank template? Or save the filenames as values in a workbook and delete the original file?
 
Upvote 0
Well, I wish you luck as you wait for further responses because for me, that answer sheds no light on why the suggestion wouldn't solve the issue. Seems to me that if you replace a file with a blank template, you don't have to worry about version history.
 
Upvote 1
Solution
Well, I wish you luck as you wait for further responses because for me, that answer sheds no light on why the suggestion wouldn't solve the issue. Seems to me that if you replace a file with a blank template, you don't have to worry about version history.
Basically, we create about three sometimes up to ten per day, so over the space of 6 years, that’s a lot to sit through.

For data retention, it would be easier to set a time bomb on each sheet
 
Upvote 0

Forum statistics

Threads
1,215,220
Messages
6,123,698
Members
449,117
Latest member
Aaagu

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