|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
哪位高手帮看下下面的代码,在excel不能通过,我想每行一个记录都统计检测时间,时间记录咋c3里。谢谢!
着急!
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Target.Cells.Count = 1 And (Not Intersect(Target.Cells(1), Range("B1")) Is Nothing) Then
[B1] = "开始时间"
[C1] = Format(Now(), "Hh:mm:Ss")
[D1] = Timer [D1].Font.ColorIndex = 2
[B2:D3].ClearContents
End If
If Target.Cells.Count = 1 And (Not Intersect(Target.Cells(1), Range("B2")) Is Nothing) Then
[B2] = "结束时间"
[C2] = Format(Now(), "Hh:mm:Ss")
[D2] = Timer [D2].Font.ColorIndex = 2
[B3] = "总共用时"
[C3] = Format([D2] - [D1], "#0.00")
[D3] = "秒"
End If
Target.Offset(1, 0).Select
End Sub |
|