本帖最后由 q23 于 2023-6-6 10:56 编辑
求大神,下面的代码执行不出结果,汇总表没有数据
Sub a()
Dim a%, b%, c%, d%, e$, f$, at, bt
e = Format(Now(), "yyyy")
f = Format(Now(), "mm")
Set at = Sheets("考勤表").Range("s4:AW3000").CurrentRegion
With Sheets("汇总表")
.Range("a2").Resize(Rows.Count - 2, 7).ClearContents
bt = .Range("a2").Resize(25678, 4)
End With
For a = 4 To 3000
For b = 19 To 49
If InStr(at(a, b), "h") Then
d = d + 1
bt(d, 1) = at(a, 1)
bt(d, 2) = at(a, 2)
bt(d, 3) = DateSerial(e, f, at(2, b))
bt(d, 4) = at(a, b)
End If
Next
Next
End Sub
|