Dim rng(1), E As Range
Set rng(1) = Sheets("sheets1").Range("A1", Range("A" & Rows.Count).End(xlUp))
For Each E In rng(1)
E.Offset(, 3) =( E.Offset(, 2)-E.Offset(, 2))*86400
sub test ()
Application. screenupdate=false
Dim rng(1),M as Range
Sheets("貼這").Range(h:h).Clear
Set rng(1)=Sheets("貼這"). Range("A2",Range("A"&Rows.count).End(xlUp))
For Each M In rng(1)
M.Offset(,7)=(M.Offset(,3)-M.Offset(,2))*86400
If M.Offset(,7)<0 Then
M.Offset(,7)==""
End If
Next
End sub作者: GBKEE 時間: 2014-10-13 06:08