2016-02-04 3 views

ответ

0

Перейти к ур отличиться и сделать это

search for ur format type and done

Update 1: Хорошо попробовать, что

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" & Rows.Count).End(xlUp).Row 'Get The Last Row in Column Change A as Needed 

For Each CurrentCell In Range("A1:A" & LastRow) ' Loop through all cells. Change Column as needed 

    If InStr(CurrentCell.Value, "/") <> 0 Then 'To make sure only convert non converted ones 

    RegEx.Pattern = "(\d{4})/(\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 

Изменить код, как и нужно

Update 2 : попробуйте

format(now(), "yyyy-MM-dd hh:mm:ss") 
+0

Нажмите, чтобы посмотреть изображение – Lucas

+0

Я изменил формат и ничего. Также я попробовал = ТЕКСТ (CELL; «yyyy-mm-aa HH: MM: ss») и не работал – Pau

+0

Я обновил сообщение – Lucas

Смежные вопросы