Hi Experts,
I have the following code in an excel message box that pops up when the wrong data is entered.
For Each c In Range("D5:FU211").Cells
If c.Value = "ERROR" Then _
MsgBox "Ending Date Must be Later than Beginning Date", _
vbCritical, "Date Error: " & c.Address(0, 0)
Next c
Is there a code to add to the pop up above that will either highlight or delete the last cell data input that caused the error function above.
I know this can be done with the undo button in the heading bars, but I would like for it to happen automaticly when the pop up occurs. The cell that triggers the message box has a validation function with choices to choose a date.
Thank you for your help,
Robert
Start Free Trial