Morning all, I've got a workbook, with a number of UserForms on which allow entry of multiple types of data, including text, numerics, and a lot of date fields. All seems to be working well, except if a user wants to delete a date, using the appropriate userform, it doesn't overwrite the value in the worksheet. Below is the code I'm using to check if the value in the userform is a date, and then populate the worksheet, but it's doing nothing. Any help appreciated.
ws.Cells(lastRow, txtCollectionDate.Tag).Value = IIf(IsDate(txtCollectionDate), CDate(txtCollectionDate), "")
Update: txtCollectionDate is a textbox, it's value originally was 09/01/2016, but the user wants to delete this, as it was entered in error. User should be able to highlight the value, press delete (keyboard), then save.
txtCollectionDate
if it does nothing and mention what are your default date settings for short date in Excel and in your operating system. – Axel Richterit doesn't overwrite the value in the worksheet
- does that mean it does nothing? or that it replaces the value with blank? – SierraOscar