Here’s what I want to do and I realized it wasn’t working.
If Time > 23 And Time < 7 Then
ws.Cells(Target.Row, 12).Value = 3
ElseIf Time > 7 And Time < 15 Then
ws.Cells(Target.Row, 12).Value = 1
Else
ws.Cells(Target.Row, 12).Value = 2
End If
What I want to do with this stuff… if the actual time is over 11 PM but less than 7 am… it writes 3 in a cell… and so on… The problem is that I realized that this comporison Time > 23 or Time < 7 doesn’t work… how can I compare Time function with the actual hour?
Thanks!
Give this a try