Break timestamps into shifts with VBA
Name fields by time of day. Set a time range for naming fields.
Use the if function to separate time stamps.
For more help visit my website or email me at easyexcelanswers@gmail.com
I am able to provide online help on your computer at a reasonable rate.
MY videos are all created on Camtasia.
Follow me on Facebook
Sub shifts()
Dim i As Integer
i = 2
Do While Cells(i, 1) (symbol for not equal) “”
Worksheets(“sheet1”).Select
If Cells(i, 1).Value (symbol for greater than) TimeSerial(7, 1, 0) And Cells(i, 1).Value (symbol for less than)TimeSerial(15, 30, 0) Then
Cells(i, 2) = “day”
Else
If Cells(i, 1).Value(symbol for greater thanTimeSerial(15, 30, 0) And Cells(i, 1).Value (symbol for less than) TimeSerial(23, 59, 0) Then
Cells(i, 2) = “afternoon”
Else
Cells(i, 2) = “night”
End If
End If
i = i + 1
Loop
End Sub
Watch more new videos about Excel Office | Synthesized by Mindovermetal English
wow it's awesome thank you teacher