Created
October 10, 2016 08:33
-
-
Save TABETA/dac49b55f7a8252e571988b7fd3ec713 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function truncDate(t As Date) As Date | |
truncDate = TimeSerial(Hour(t), Minute(t), 0) | |
End Function | |
Function findTime(r As Long, c As Long) As Long | |
findTime = Application.WorksheetFunction.Match(CDbl(truncDate(Cells(r, c))), Range("2:2"), 1) | |
End Function | |
Sub t() | |
Dim cs As Long | |
Dim ce As Long | |
Dim c As Long | |
Dim r As Long | |
Dim MaxRow As Long | |
MaxRow = Cells(3, 1).End(xlDown).Row | |
For r = 3 To MaxRow | |
cs = findTime(r, 1) | |
ce = findTime(r, 2) | |
For c = cs To ce | |
Cells(r, c).Value = "o" | |
Next | |
Next | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment