fraudit
New Member
- Joined
- Jan 14, 2015
- Messages
- 11
I'm getting some time & date values in the UTC time - they look like this yyyy-mm-dd HH:mm:ss:fff UTC, e.g.:
I'm using text to columns to cut off the UTC part and I need to convert the resulting date & time into CET, so I simply need to add one hour to it.
I've come up with the following code but it fails to work . Could anyone help me to solve this?
Code:
2018-07-13 10:01:11.427 UTC
2018-07-13 10:01:10.612 UTC
2018-07-13 10:01:03.931 UTC
2018-07-13 10:00:58.201 UTC
2018-07-13 10:00:55.298 UTC
I've come up with the following code but it fails to work . Could anyone help me to solve this?
Code:
Sub CET_Time()
Dim LastRow LastRow = ActiveSheet.UsedRange.Rows.Count
With Range("A2:A" & LastRow)
.TextToColumns Destination:=Range("B2"), DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(19, 9)), TrailingMinusNumbers:=True
End With
Range("B2:B" & LastRow).Value = DateAdd("h", 1, Range("B2:B" & LastRow).Value)
End Sub
Last edited: