|
楼主 |
发表于 2017-5-22 07:57
|
显示全部楼层
For iData = 1 To UBound(vData)
If vData(iData, 2) >= dStart And vData(iData, 2) <= dEnd Then
If Not oDic.Exists(vData(iData, 1)) Then
iFill = iFill + 1
ReDim Preserve vFill(1 To iTotalDay * 3 + 1, 1 To iFill)
oDic(vData(iData, 1)) = iFill
vFill(1, iFill) = vData(iData, 1)
For iRow = 2 To iTotalDay * 3 + 1
vFill(iRow, iFill) = "缺签"
Next
End If
iRow = oDic(vData(iData, 1))
sTime = Format(vData(iData, 2), "HH:MM")
iDay = Day(vData(iData, 2))
If sTime <= "09:00" Then
If sTime <= IIf(IsDate(vFill(2 + (iDay - iStartDay) * 3, iRow)), Format(vFill(2 + (iDay - iStartDay) * 3, iRow), "HH:MM"), "08:30") Then _
vFill(2 + (iDay - iStartDay) * 3, iRow) = TimeValue(sTime)
ElseIf sTime >= "12:00" And sTime <= "15:00" Then
If sTime >= IIf(IsDate(vFill(3 + (iDay - iStartDay) * 3, iRow)), Format(vFill(3 + (iDay - iStartDay) * 3, iRow), "HH:MM"), "12:00") Then _
vFill(3 + (iDay - iStartDay) * 3, iRow) = TimeValue(sTime)
ElseIf sTime >= "16:00" Then
If sTime >= IIf(IsDate(vFill(4 + (iDay - iStartDay) * 3, iRow)), Format(vFill(4 + (iDay - iStartDay) * 3, iRow), "HH:MM"), "17:00") Then _
vFill(4 + (iDay - iStartDay) * 3, iRow) = TimeValue(sTime)
End If
End If
这可也是提取三个时间段的,怎么用到这个表格中时,就不合适了,? |
|