- ©«¤l
- 1446
- ¥DÃD
- 40
- ºëµØ
- 0
- ¿n¤À
- 1470
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Excel 2010 & 2016
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2020-7-15
- ³Ì«áµn¿ý
- 2024-11-28
|
VBA¤¤ªº°}¦C¥Îªk, n¦ÂI¤F¸Ñ,
³Ì¦n¤]²z¸Ñ¦r¨å¥Îªk,
¦r¨å+°}¦C, ¥i³B²z«Ü¦hºØ¸ê®Æªº³B²z¤Î²Îp¹Bºâ»Ý¨D,
...
ã´£³¡ªL µoªí©ó 2020-8-24 17:19
ÁÂÁ«e½ú«ü¾É
«á¾Ç¾q¶w! ¸g¹L¤F2¦~¤~¾Ç¨ì°}¦C»y¦r¨åªº¤@ÂIÂI¥Ö¤ò
¶Ô¯à¸É©å!,¥Ã¤£©ñ±ó!
¤U¦Cµ{¦¡½X¬O¤µ¤é¾Ç²ß¨ìªº¦r¨å»P°}¦C§Þ¥©
¦A½Ð«e½ú¼·ªÅ¦A«ü¾É- Option Explicit
- Sub TEST_20220920_3()
- Dim Brr, R&, C&, i&, j&, k%, T$, TT, Y, Z, W, P, Q
- Dim Crr, V, xR, n
- TT = Timer
- Set Y = CreateObject("Scripting.Dictionary")
- Set Z = CreateObject("Scripting.Dictionary")
- Set V = CreateObject("Scripting.Dictionary")
- Set Z = ActiveSheet.Cells
- For i = 1 To 4
- Set V(i) = CreateObject("Scripting.Dictionary")
- Next
- R = Z(Rows.Count, "D").End(xlUp).Row '³Ì«á¤@¦æ
- W = Z(12, Columns.Count).End(xlToLeft).Column '³Ì«á¤@Äæ
- Crr = Z(12, 33).Resize(R - 11, W - 32)
- Z = Z(1, 1).Resize(R, W) '©w¸q¸ê®Æ½d³ò--A1¦Ü¾ãÓ°Ï
- For i = 1 To 13 Step 4
- Y.Add Mid(Z(11, i + 12), 2, 2), (i + 3) / 4
- Next
- For i = 33 To W Step 4
- P = Right(Split(Z(11, i), "]")(0), 2)
- V(Y(P)).Add V(Y(P)).Count, i
- Next
- ReDim Brr(1 To R - 12, 1 To 20) '³]ªÅ°}¦C
- For i = 13 To R
- For Each xR In V(1)
- If Z(i, V(1)(xR) + 1) > Brr(i - 12, 2) Then
- Brr(i - 12, 1) = Z(i, V(1)(xR))
- Brr(i - 12, 2) = Z(i, V(1)(xR) + 1)
- End If
- If Z(i, V(1)(xR) + 1) - Z(i, V(1)(xR)) > Brr(i - 12, 3) Then
- Brr(i - 12, 3) = Z(i, V(1)(xR) + 1) - Z(i, V(1)(xR))
- End If
- Next
- For n = 1 To 3
- For Each xR In V(n + 1)
- Brr(i - 12, n * 4 + 1) = Brr(i - 12, n * 4 + 1) + Z(i, V(n + 1)(xR))
- Brr(i - 12, n * 4 + 2) = Brr(i - 12, n * 4 + 2) + Z(i, V(n + 1)(xR) + 1)
- Brr(i - 12, n * 4 + 3) = Brr(i - 12, n * 4 + 2) - Brr(i - 12, n * 4 + 1)
- Next
- Next
- For n = 1 To 3
- For j = 1 To 3
- Brr(i - 12, 16 + n) = Brr(i - 12, 16 + n) + Brr(i - 12, j * 4 + n)
- Next
- Next
- Next i
- [M13].Resize(UBound(Brr), UBound(Brr, 2)) = Brr
- MsgBox Timer - TT
- End Sub
½Æ»s¥N½X |
|