Skip to content

Instantly share code, notes, and snippets.

@AdamDimech
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AdamDimech/3d54bc9a3d61b461e914 to your computer and use it in GitHub Desktop.
Save AdamDimech/3d54bc9a3d61b461e914 to your computer and use it in GitHub Desktop.
Remove the time from an Excel column of data containing date text in the format DD/MM/YY HH:MM:SS
Sub StripTimeFromDate()
Dim DateTime As Long, i As Long
DateTime = Range("D" & Rows.Count).End(xlUp).Row
For i = 2 To DateTime
With Range("D" & i)
.NumberFormat = "dd/mm/yy"
.Value = DateValue(.Value)
End With
Next i
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment