Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Okay, so after reading this article here: <a href="http://allenbrowne.com/ser-36.html" rel="nofollow">http://allenbrowne.com/ser-36.html</a> I made some tweaks to the code:</p> <pre><code> Option Explicit ' Developed by Contextures Inc. ' www.contextures.com Private Sub Worksheet_Change(ByVal Target As Range) Dim rngDV As Range Dim oldVal As String Dim newVal As String If Target.Count &gt; 1 Then GoTo exitHandler On Error Resume Next Set rngDV = Cells.SpecialCells(xlCellTypeAllValidation) On Error GoTo exitHandler If rngDV Is Nothing Then GoTo exitHandler If Intersect(Target, rngDV) Is Nothing Then 'do nothing Else Application.EnableEvents = False 'newVal = Target.Value 'amendment newVal = Format(Target.Value, "\ dd\/mm\/yyyy\") Application.Undo 'oldVal = Target.Value 'amendment oldVal = Format(Target.Value, "\ dd\/mm\/yyyy\") Target.Value = newVal If Target.Column &gt; 1 Then 'amendment If oldVal = "" Then 'do nothing Else If newVal = "" Then 'do nothing Else Target.Value = oldVal _ &amp; ", " &amp; newVal End If End If End If End If </code></pre> <p>exitHandler: Application.EnableEvents = True End Sub</p> <p>The important bit appears to be the format: </p> <pre><code>oldVal = Format(Target.Value, "\ dd\/mm\/yyyy\") </code></pre> <p>Allen's suggested code was:</p> <pre><code>Format$(varDate, "\#mm\/dd\/yyyy\#") </code></pre> <p>I changed it to dd/mm and replaced the # with a space, and hey presto - it appears to be working! A very frustrating issue though, which I'll now have to make sure works on other users machines! Thanks to @sous2817 and @GSerg for their comments/suggestions.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload