- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
        
|
¦^´_ 1# b9208
¸Õ¸Õ¬Ý- Option Explicit
- Sub Ex()
- Dim D(1 To 2) As Object, i As Integer, M As String
- Dim R As Integer, C As Integer, A As Range
- Set D(1) = CreateObject("scripting.dictionary") '¦r¨åª«¥ó
- Set D(2) = CreateObject("scripting.dictionary")
- With Sheets("©ú²Ó")
- i = 6
- Do While .Cells(i, "d") <> ""
- M = .Cells(i, "D") & Mid(.Cells(i, "E"), 1, 4) & .Cells(i, "F")
- D(1)(M) = D(1)(M) + 1 '¥þ³¡
- M = .Cells(i, "D") & Mid(.Cells(i, "E"), 1, 4) & .Cells(i, "F") & .Cells(i, "L")
- D(2)(M) = D(2)(M) + 1 '°Ï°ì
- i = i + 1
- Loop
- End With
- With Sheets("²Îp")
- For Each A In .Range("F3:J12,F18:J27,F33:J42,F48:J57").Areas '×¥¿¬°§Aªº¥þ³¡ ¤Î °Ï°ì ªº½d³ò
- With A
- For R = 3 To .Rows.Count - 1
- For C = 2 To .Columns.Count
- If .Cells(1) = "¥þ³¡" Then '¥þ³¡
- .Cells(R, C) = D(1)(.Cells(R, 1) & Mid(.Cells(1, C), 1, 4) & .Cells(2, C))
- Else '°Ï°ì
- .Cells(R, C) = D(2)(.Cells(R, 1) & Mid(.Cells(1, C), 1, 4) & .Cells(2, C) & .Cells(1))
- End If
- Next
- Next
- For C = 2 To .Columns.Count
- .Cells(.Rows.Count, C).FormulaR1C1 = "=SUM(R[-" & .Rows.Count - 3 & "]C:R[-1]C)" '¤½¦¡
- .Cells(.Rows.Count, C) = .Cells(.Rows.Count, C).Value
- Next
-
- End With
- Next
- End With
- End Sub
½Æ»s¥N½X |
|