|
Sub aa()
a = Now()
k = 1
arr = Split(a, "/")
d1 = arr(0)
d = arr(1)
d2 = arr(2)
cc = Mid(d2, 1, 2)
If d = 1 Or d = 3 Or d = 5 Or d = 7 Or d = 8 Or d = 10 Or d = 12 Then
dd = 31
End If
If d = 4 Or d = 6 Or d = 9 Or d = 11 Then
dd = 30
End If
If d = 2 Then
dd = 28
End If
MsgBox 2018 & "/" & d - 1 & "/" & dd
For i = 2 To Sheets("五级分类不一致借据清单").UsedRange.Rows.Count
If Sheets("五级分类不一致借据清单").Cells(i, 6).Text = 2018 & "/" & d - 1 & "/" & dd Then
k = k + 1
Sheets("xx月xx日新发放").Cells(k, 1).Resize(1, 34) = Sheets("五级分类不一致借据清单").Cells(i, 1).Resize(1, 34).Value
End If
Next
Sheets("xx月xx日新发放").Name = d & "月" & cc & "日" & "新发放"
End Sub |
|