Time Lapsed code to delete code !

Eurekaonide

Active Member
Joined
Feb 1, 2010
Messages
433
Hi All

What sort of code would I need to write which could be triggered by a date and effectively delete VBA Code?

I have something that needs to run till a said time and then be deleted as it could interfere with other codes running after this time.
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Or just put the code directly in your Workbook_Open event handler.

(You don't need that Else: Exit Sub - it isn't actually doing anything.)
 
Upvote 0
OK another question, I thought I ahd this sorted but it doesn't seem to be working :-(

I want the code to action on or after a set date so I had the following;

HTML:
If Date = DateValue <= ("30/06/2011") Then

But it doesnt seem to work, it either deletes it before the time or if I put the date to today or to a past date it doesn't delete it, am I going mad?? I ahve used both the < and > signs and it doesn't appear to make a difference
 
Upvote 0
Code:
If Date >= DateValue("30/06/2011") Then
 
Upvote 0

Forum statistics

Threads
1,224,567
Messages
6,179,571
Members
452,927
Latest member
whitfieldcraig

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