- ©«¤l
- 254
- ¥DÃD
- 6
- ºëµØ
- 0
- ¿n¤À
- 310
- ÂI¦W
- 0
- §@·~¨t²Î
- W10
- ³nÅ骩¥»
- Excel 2016
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2019-6-16
- ³Ì«áµn¿ý
- 2024-9-23
|
¦^´_ 59# wei9133
¦³ªÅÀ°§Ú¸Õ¸Õ¬Ý ³oÓÀ³¸Ó¥i¥H ¦ý¬O¦³¤@ӫܤjªº°ÝÃD ...¦pªG¸ê®Æ«Ü¦h ·|¶]«D±`ºC....- Public Sub ½m²ß1116()
- Sheets(2).Select
- Rows(2).Select
- ActiveWindow.FreezePanes = False
- Application.ScreenUpdating = False
- Sheets(2).[A1].CurrentRegion.Clear
- Sheets(1).Select
- Dim Arr, D, xD, x&, y&, k&, T1$, T2$, T3$, T4$
- Set xD = CreateObject("Scripting.Dictionary")
- Arr = Range(Cells(Rows.Count, 1).End(xlUp), Cells(1, 115))
- For x = 2 To UBound(Arr, 1)
- T1 = ""
- For y = 1 To 51
- T1 = T1 & Arr(x, y)
- If Arr(x, y) = "" Then T1 = T1 & "-"
- Next y
- T3 = ""
- For y = 52 To 102
- T3 = T3 & Arr(x, y)
- If Arr(x, y) = "" Then T3 = T3 & "-"
- Next y
- T1 = T1 & T3 & Arr(x, 106)
- T3 = ""
- If Arr(x, 103) = "" Then
- Arr(x, 103) = 1
- xD(T1) = xD(T1) + Arr(x, 103)
- ElseIf Arr(x, 103) <> "" Then
- xD(T1) = xD(T1) + Arr(x, 103) + 1
- End If
- xD(T1 & 105) = xD(T1 & 105) + Arr(x, 105)
- xD(Arr(x, 106)) = xD(Arr(x, 106)) + 1
- Next x
- T1 = "": k = 2
- For Each D In xD
- For x = 2 To UBound(Arr, 1)
- T2 = ""
- For y = 1 To 51
- T2 = T2 & Arr(x, y)
- If Arr(x, y) = "" Then T2 = T2 & "-"
- Next y
- T4 = ""
- For y = 52 To 102
- T4 = T4 & Arr(x, y)
- If Arr(x, y) = "" Then T4 = T4 & "-"
- Next y
- T2 = T2 & T4 & Arr(x, 106)
- T4 = ""
- If D = T2 Then
- Arr(x, 103) = xD(D) - 1
- Arr(x, 105) = xD(D & 105)
- If Arr(x, 107) <> "" Or Arr(x, 109) <> "" _
- Or Arr(x, 115) <> "" Or Arr(x, 104) <> "" Then
- For y = 1 To UBound(Arr, 2)
- Arr(k, y) = Arr(x, y)
- Next y
- k = k + 1
- Exit For
- End If
- End If
- If D = Arr(x, 106) And xD(D) = 1 _
- And Arr(x, 107) = "" And Arr(x, 109) = "" _
- And Arr(x, 115) = "" And Arr(x, 104) = "" Then
- For y = 1 To UBound(Arr, 2)
- Arr(k, y) = Arr(x, y)
- Next y
- k = k + 1
- Exit For
- End If
- Next x
- If Arr(k - 1, 103) = 0 Then Arr(k - 1, 103) = ""
- If Arr(k - 1, 105) = 0 Then Arr(k - 1, 105) = ""
- Debug.Print k
- Debug.Print D
- Next D
- T2 = "": Set xD = Nothing
- Sheets(2).Range("A1").Resize(k - 1, UBound(Arr, 2)) = ""
- Sheets(2).Range("A1").Resize(k - 1, UBound(Arr, 2)) = Arr
- Erase Arr
- Application.ScreenUpdating = True
- Sheets(2).Select
- Rows(2).Select
- ActiveWindow.FreezePanes = True
- Cells(Rows.Count, 106).End(xlUp).Select
- End Sub
½Æ»s¥N½X |
|