|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Sub 插入行计算()
With Sheets("打卡时间")
rs = .Cells(Rows.Count, 1).End(xlUp).Row
For i = rs To 4 Step -1
.Rows(i).Insert Shift:=xlDown
Next i
rs = .Cells(Rows.Count, 1).End(xlUp).Row
For i = 3 To rs Step 2
For j = 2 To 32
If Trim(Cells(i, j)) <> "" Then
If InStr(Cells(i, j), Chr(10)) > 0 Then
rr = Split(Cells(i, j), Chr(10))
ks = rr(0)
js = rr(UBound(rr))
Cells(i + 1, j) = DateDiff("h", ks, js)
End If
End If
Next j
Next i
End With
MsgBox "ok!"
End Sub
|
评分
-
1
查看全部评分
-
|