Timestamp_Clean_Up.txt

(0 KB) Pobierz
Sub RemoveTimeAndTimezone()
    Dim ws As Worksheet
    Dim rng As Range
    Dim cell As Range
    Dim newValue As String

    ' Set the worksheet
    Set ws = ThisWorkbook.Sheets("Sheet1") ' Change "Sheet1" to the name of your sheet

    ' Set the range to column B starting from row 1 to the last row with data
    Set rng = ws.Range("B1:B" & ws.Cells(ws.Rows.Count, "B").End(xlUp).Row)

    ' Loop through each cell in the range
    For Each cell In rng
        ' Split the cell value by space and take the first part
        newValue = Split(cell.Value, " ")(0)
        ' Set the cell value to the new value
        cell.Value = newValue
    Next cell
End Sub
Zgłoś jeśli naruszono regulamin