- ©«¤l
- 1447
- ¥DÃD
- 40
- ºëµØ
- 0
- ¿n¤À
- 1471
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Excel 2010 & 2016
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2020-7-15
- ³Ì«áµn¿ý
- 2024-12-5
|
ÁÂÁ½׾Â,ÁÂÁ¦U¦ì«e½ú
«á¾ÇÂǦ¹©«½m²ß°}¦C»P¦r¨å,¾Ç²ßªº¤è®×¦p¤U,½Ð¦U¦ì«e½ú«ü±Ð
°õ¦æµ²ªG:
Option Explicit
Sub TEST()
Dim Brr, Crr, Z, i&, j%, C%, N&, X%, T$, ¯Z¯Å$
¤u§@ªí2.UsedRange.ClearContents
Set Z = CreateObject("Scripting.Dictionary")
Brr = Range(¤u§@ªí1.[N1], ¤u§@ªí1.[B65536].End(3)(1, 0))
ReDim Crr(UBound(Brr), 1 To 20)
For i = 1 To UBound(Brr)
Z(Application.Text(i, "[DBNum1]")) = i
If Brr(i, 2) = "¾Ç¡@¸¹" Then
¯Z¯Å = Z(Mid(Brr(i - 2, 2), 2, 1)) & Mid(Brr(i - 2, 2), 4, 2)
For j = 5 To UBound(Brr, 2)
T = Brr(i, j): If T = "" Then C = j - 1: Exit For
If Not Z.Exists(T) Then X = X + 1: Z(T) = X + 4: Crr(0, X + 4) = T
Z(j) = Z(T)
Next
End If
If Brr(i, 2) Like "######" Then
N = N + 1: For j = 5 To 20: Crr(N, j) = -1: Next
Crr(N, 1) = Brr(i, 2): Crr(N, 2) = Brr(i, 3): Crr(N, 3) = ¯Z¯Å: Crr(N, 4) = Brr(i, 4)
For j = 5 To C: Crr(N, Z(j)) = Brr(i, j): Next
End If
Next
With ¤u§@ªí2.[A1].Resize(N + 1, X + 4): .NumberFormat = "@": .Value = Crr: End With
¤u§@ªí2.[A1].Resize(, 4) = [{"¾Ç¡@¸¹","©m¦W","¯Z¯Å","®y¸¹"}]
End Sub |
|