Разделение столбца даты и времени в Excel vba на два отдельных столбца дает разные результаты в зависимости от того, больше ли часть dd больше 12 или нет

Считаете ли вы использование jQuery, чтобы избежать обнаружения браузера? С jQuery это было бы так же просто, как:

$("#mytest1").click();
0
задан Pᴇʜ 17 January 2019 в 07:08
поделиться

1 ответ

Должно работать что-то вроде следующего:

Sub SplitDateTime()
Dim dDate As Date
Dim dTime As Date
Dim x As Integer

MsgBox "Split Date Time"
For x = 2 To 21
    'Sets the date in the cell of the first column
    dDate = Cells(x, 2)
    With Cells(x, 2)
        .Value = Int(dDate)
        .NumberFormat = "dd/mm/yy"
    End With

    'Sets the time in the cell of the second column
    With Cells(x, 3)
        .Value = dDate - Int(dDate)
        .NumberFormat = "hh:mm"
    End With
Next x
End Sub
0
ответ дан Ron Rosenfeld 17 January 2019 в 07:08
поделиться
Другие вопросы по тегам:

Похожие вопросы: