I am currently using the following code to add todays date into D when data is entered into G.
How can I modify it so that if the user erases the data in G then the date in D is also cleared?Please Login or Register to view this content.
I am currently using the following code to add todays date into D when data is entered into G.
How can I modify it so that if the user erases the data in G then the date in D is also cleared?Please Login or Register to view this content.
Would this work?
Please Login or Register to view this content.
Last edited by berlan; 12-15-2013 at 05:03 PM.
If you make a change to a cell within the Worksheet Change event handler, you should usebefore, andPlease Login or Register to view this content.
after the change.Please Login or Register to view this content.
Regards, TMS
Trevor Shuttleworth - Retired Excel/VBA Consultant
I dream of a better world where chickens can cross the road without having their motives questioned
'Being unapologetic means never having to say you're sorry' John Cooper Clarke
Nice inputs TMShucks. With that in mind:
Please Login or Register to view this content.
@berlan: You're welcome.
Thank you for you responses. I tried that code, and while it will add the date when data is entered its not erasing it.
I have attached my worksheet. The sheet in question is ReturnData. (hit Start Scan at the top to find the next empty row in G, and type in 58883)
TMShucks out of interest why is the Application.EnableEvents code required? Ive been using that original code without any issues.
Sorry, I am afraid that I misunderstood you. I thought you also wanted to clear column G if you cleared the date.
This may work:
By setting the Application.EnableEvents to false, it won't trigger any events that might occure by adding data to column D within the routine, in this case.Please Login or Register to view this content.
Perfect, that did it. Thank you.
Anytime, Nitefox! Glad it worked
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks