|
- Sub qs() '2024/10/23
- Application.ScreenUpdating = False
- Dim arr, i
- arr = Sheet2.Range("a1").CurrentRegion.Value
- brr = Sheet2.Range("a1").CurrentRegion.Value
- st1 = TimeValue("7:00"): st2 = TimeValue("9:30")
- xt1 = TimeValue("14:30"): xt2 = TimeValue("16:30")
- For i = 3 To UBound(arr)
- For j = 3 To UBound(arr, 2)
- If arr(i, j) = "" Then
- brr(i, j) = "未到班"
- Else
- If arr(2, j) = "一" Then
- b = Split(arr(i, j), Chr(10))
- For x = 0 To UBound(b)
- If Len(b(x)) > 0 Then
- If TimeValue(b(x)) > xt2 Then brr(i, j) = "未到班" Else brr(i, j) = "到班"
- End If
- Next
-
- Else
- a = Split(arr(i, j), Chr(10))
- aa = ""
- For ai = LBound(a) To UBound(a)
- If Len(a(ai)) > 0 Then
- aa = aa & "," & a(ai)
- End If
- Next ai
- aa = Split(Mid(aa, 2), ",")
- If UBound(aa) = 0 Then
- brr(i, j) = "打卡信息不全"
- Else
- xx = TimeValue(aa(UBound(aa))) - TimeValue(aa(0))
- xx = Format(xx, "hh:mm:ss")
- brr(i, j) = xx
- End If
- End If
- End If
- Next j
- Next i
- Sheet2.Range("AF1").Resize(10000, 100) = Empty
- Sheet2.Range("AF1").Resize(UBound(arr), UBound(arr, 2)) = brr
- Application.ScreenUpdating = True
- End Sub
复制代码 |
|