- ©«¤l
- 4901
- ¥DÃD
- 44
- ºëµØ
- 24
- ¿n¤À
- 4916
- ÂI¦W
- 247
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Office 20xx
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-4-30
- ³Ì«áµn¿ý
- 2024-11-14
|
¦^´_ 8# candy516 - Sub ex()
- Set d = CreateObject("Scripting.Dictionary")
- Application.ScreenUpdating = False
- With Sheet1
- For Each a In .Range(.[A2], .[A2].End(xlDown))
- d(a & Year(a.Offset(, 1))) = Array(a.Offset(, 1), a.Offset(, 2))
- Next
- End With
- For y = 2001 To 2010
- With Sheets(CStr(y))
- If Application.CountBlank(.Range(.[B1], .[IV1].End(xlToLeft))) > 0 Then .Range(.[B1], .[IV1].End(xlToLeft)).SpecialCells(xlCellTypeBlanks).EntireColumn.Delete
- .Range(.[IV1].End(xlToLeft).Offset(, 1), .[IV1]).EntireColumn.Clear
- k = 2
- Do Until .Cells(1, k) = ""
- .Columns(k + 1).Insert
- mystr = .Cells(1, k) & y
- Set a = .Columns("A").Find(d(mystr)(0))
- If Not a Is Nothing Then
- cnt = 0
- r = a.Row
- test = .Cells(r - 1, k)
- r = r + 1
- cnt = cnt + 1
- Do Until .Cells(r, k) >= test Or .Cells(r, k) = ""
- cnt = cnt + 1
- r = r + 1
- Loop
- If .Cells(r, 1) = "" Then
- .Cells(a.Row, k + 1) = "µL¶ñÅv"
- Else
- .Cells(a.Row, k + 1) = cnt
- End If
- End If
- k = k + 2
- Loop
- End With
- Next
- Application.ScreenUpdating = True
- End Sub
½Æ»s¥N½X |
|