Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Try using this Custom Format: </p> <pre><code>yyyy/mm/dd h:mm;@ </code></pre> <p>To enter it, right click on the cell and Choose Format Cell: </p> <p><img src="https://i.stack.imgur.com/SC3Ow.jpg" alt="Format Cell"></p> <p>Then under the <code>Number</code> Tab Select <code>Custom</code> from the listbox. And enter the provided format in the <code>Type:</code> textbox.</p> <p><img src="https://i.stack.imgur.com/fpY36.jpg" alt="Example"></p> <p>If that doesn't work. Are you *****Absolutely***** Positive that 04/06/2013 09:00:00 IS April 6, 2013 and NOT June 4, 2013?? </p> <p>If this still doesn't work and you have verified that dates are correct. </p> <pre><code>Sub ChangeDateFormat() Application.ScreenUpdating = False Dim CurrentCell As Range Dim LastRow As Long Dim RegEx As Object Set RegEx = CreateObject("vbscript.regexp") RegEx.Global = True LastRow = Range("A" &amp; Rows.Count).End(xlUp).Row 'Get The Last Row in Column Change A as Needed For Each CurrentCell In Range("A1:A" &amp; LastRow) ' Loop through all cells. Change Column as needed If InStr(CurrentCell.Value, "/") &lt;&gt; 0 Then 'To make sure only convert non converted ones RegEx.Pattern = "(\d{2})/(\d{2})/(\d{4}) (\d{2}):(\d{2}):(\d{2})" ' Seperate all parts of imported Data into groups CurrentCell.Value = RegEx.Replace(CurrentCell.Value, "$3.$2.$1 $4:$5") ' Change order of groups and place into cell. End If Next Application.ScreenUpdating = True End Sub </code></pre> <p>*****NOTE: ***** This will only work if <strong>ALL</strong> date values are of <code>dd/mm/yyyy hh:mm:ss</code> if they are not you will have to add some Error Handling and possibly slightly modify the code as it <strong><em>WILL</em></strong> cause problems. </p> <p>This will also work on dates that are inside of other text. If the value of <code>A1</code> is </p> <p><code>This is a test 04/06/2013 09:00:00 Lets see what happens</code> </p> <p>Then the new value will be</p> <p><code>This is a test 2013.06.04 09:00 Lets see what happens</code></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.
 

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