|
发表于 2017-9-26 11:17
|
显示全部楼层
本楼为最佳答案
- Sub aaa()
- With Sheet1
- .Range("Ai4:Ai10000").ClearContents
- For i = 4 To .Range("e65536").End(3).Row
- If .Cells(i, 15) <> "" Then
- If .Cells(i, 17) = "" Then
- D = Date
- Else
- D = .Cells(i, 17)
- End If
- .Cells(i, 35) = D - .Cells(i, 15)
- End If
- Next
- End With
- With Sheet2
- .Range("Ai4:Ai10000").ClearContents
- For i = 4 To .Range("e65536").End(3).Row
- If .Cells(i, 17) <> "" Then
- If .Cells(i, 18) = "" Then
- D = Date
- Else
- D = .Cells(i, 18)
- End If
- .Cells(i, 35) = D - .Cells(i, 17)
- End If
- Next
- End With
- End Sub
复制代码 |
|