|
- Sub 月报()
- Dim arr
- Set d = CreateObject("scripting.dictionary")
- Sheets("出生人口").Select
- With Sheets("出生人口")
- For i = 2 To .[a65536].End(xlUp).Row
- d(.Cells(i, 2).Value & "-" & .Cells(i, 6).Value) = ""
- Next
- End With
- Sheets("新增孕情").Select
- With Sheets("新增孕情")
- For i = 2 To .[a65536].End(xlUp).Row
- d(.Cells(i, 3).Value & "-" & .Cells(i, 8).Value) = ""
- Next
- End With
- Sheets("避孕节育").Select
- With Sheets("避孕节育")
- For i = 2 To .[a65536].End(xlUp).Row
- d(.Cells(i, 3).Value & "-" & .Cells(i, 6).Value) = ""
- Next
- End With
- k = d.keys
- t = d.items
- Sheets("月报").Select
- Sheets("月报").[b5].Resize(d.Count, 1) = Application.Transpose(k)
- Sheets("出生人口").Select
- arr = Sheets("出生人口").[a1].CurrentRegion
- For i = 5 To d.Count + 5
- For j = 2 To UBound(arr)
- If Sheets("月报").Cells(i, 2) = arr(j, 2) & "-" & arr(j, 6) Then
- Sheets("月报").Cells(i, 8) = arr(j, 14)
- Sheets("月报").Cells(i, 9) = arr(j, 13)
- Sheets("月报").Cells(i, 10) = arr(j, 12)
- Sheets("月报").Cells(i, 11) = arr(j, 15)
- End If
- Next
- Next
- Sheets("新增孕情").Select
- arr = Sheets("新增孕情").[a1].CurrentRegion
- For i = 5 To d.Count + 5
- For j = 2 To UBound(arr)
- If Sheets("月报").Cells(i, 2) = arr(j, 3) & "-" & arr(j, 8) Then
- Sheets("月报").Cells(i, 5) = arr(j, 12)
- Sheets("月报").Cells(i, 7) = arr(j, 14)
- End If
- Next
- Next
- Sheets("避孕节育").Select
- arr = Sheets("避孕节育").[a1].CurrentRegion
- For i = 5 To d.Count + 5
- For j = 2 To UBound(arr)
- If Sheets("月报").Cells(i, 2) = arr(j, 3) & "-" & arr(j, 6) Then
- Sheets("月报").Cells(i, 14) = arr(j, 9)
- Sheets("月报").Cells(i, 15) = arr(j, 10)
- End If
- Next
- Next
- Sheets("月报").Select
- End Sub
复制代码
|
|