|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Public Function ?????()
Dim Ar()
Sheets("???").Select
lastrow12 = Sheets("???").Cells(65536, 2).End(xlUp).Row
Set d = CreateObject("scripting.dictionary")
Ar = Array("2020/1/2", "2020/1/3", "2020/1/4", "2020/1/5", "2020/1/6", "2020/1/7")
For i = 0 To UBound(Ar)
d(Ar(i)) = ""
Next i
For j = 5 To lastrow12
If Not d.exists(Cells(j, 2)) Then ‘ -----此处不管cells(j,2)等不于数组中的日期,
都只执行Cells(j, 7) = Cells(13, 3) + Cells(j - 1, 7) - Cells(j, 6),不知道问题出在哪里?
Cells(j, 7) = Cells(13, 3) + Cells(j - 1, 7) - Cells(j, 6)
Else
Cells(j, 7) = Cells(j - 1, 7) - Cells(j, 6)
End If
Next j
End Function
|
|