|
参与一下。。。
- Sub ykcbf() '//2024.3.28
- Set d = CreateObject("Scripting.Dictionary")
- With Sheets("缺陷代码")
- r = .Cells(Rows.Count, 1).End(3).Row
- arr = .[a1].Resize(r, 5)
- For i = 6 To UBound(arr)
- s = arr(i, 1)
- d(s) = Array(arr(i, 2), arr(i, 3), arr(i, 5))
- Next
- End With
- With Sheets("录入信息")
- t1 = CDate(.[b5])
- t2 = CDate(.[a7])
- timeDiff = DateDiff("n", t1, t2)
- daysDiff = timeDiff \ (24 * 60)
- timeDiff = timeDiff Mod (24 * 60)
- hoursDiff = Format(timeDiff \ 60, "0")
- timeDiff = Format(timeDiff Mod 60, "0")
- minsDiff = timeDiff
- p1 = daysDiff & "天" & hoursDiff & "时" & minsDiff & "分"
- .[b7] = Replace(p1, "-", "")
- st = .[c7]
- .[d7] = d(st)(0)
- .[e7] = d(st)(1)
- .[f7] = d(st)(2)
- End With
- Set d = Nothing
- MsgBox "OK!"
- End Sub
复制代码
|
评分
-
3
查看全部评分
-
|