|
将表1改名为"上传表",其他行列未变
'-----------------------------------------------
Sub jishu()
Dim i%, j%, k%, mh1%, mh%
Dim sht1 As Worksheet
Set sht1 = Sheets("上传表")
mh1 = sht1.[A65535].End(xlUp).Row
Sheets("计数").Select
mh = [A65535].End(xlUp).Row
Range("C4:N" & mh).ClearContents
For i = 2 To mh1
For j = 4 To mh
If sht1.Cells(i, 3) = Cells(j, 2) Then
k = Month(sht1.Cells(i, 5))
Cells(j, k + 2) = Cells(j, k + 2) + 1
End If
Next
Next
MsgBox "计数完成!"
End Sub
'------------------------------------------------ |
|