vba code for cutoff time

The solution for “vba code for cutoff time” can be found here. The following code will assist you in solving the problem.

Option Explicit

Sub stripTime()
Dim i As Integer
With Worksheets(“Sheet1”)
‘check to see if A1 is a date or a column text label
i = Abs(Not IsDate(.Cells(1, 1).Value))
With .Range(.Cells(1 + i, “A”), .Cells(.Rows.Count, “A”).End(xlUp))
.TextToColumns Destination:=.Cells(1, “C”), DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, xlDMYFormat), Array(10, xlSkipColumn))
‘optionally assign a custom number format
.Offset(0, 2).NumberFormat = “[color10]dd-mmm-yyyy_)”
‘optionally autofit the column width
.Offset(0, 2).EntireColumn.AutoFit
End With
End With
End Sub

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

Similar Posts