|
Sub test()
Dim ws応募 As Worksheet
Dim ws集計 As Worksheet
Dim dic As Object, k
Dim c As Range, ym As String
Set dic = CreateObject("scripting.dictionary")
Set ws応募 = Worksheets("応募")
Set ws集計 = Worksheets("集計")
For Each c In ws応募.Range("AX2", ws応募.Cells(Rows.Count, "Ax").End(xlUp))
If c.Value Like "*インスタ*" Then
With c.Offset(, 7)
If IsDate(.Value) Then ym = Format(.Value, "yyyymm")
dic(ym) = dic(ym) + 20000
End With
End If
Next
For Each k In dic.keys
If k = "202404" Then ws集計.Range("A5").Value = dic(k)
If k = "202405" Then ws集計.Range("A6").Value = dic(k)
Next
End Sub
|
|