- ©«¤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-10-21
|
°}¦C¼Æ 2 Ó> ±Æ¦C²Õ¦X 3 Ó
°}¦C¼Æ 3 Ó> ±Æ¦C²Õ¦X 7 Ó
°}¦C¼Æ 4 Ó> ±Æ¦C²Õ¦X 15 Ó
°}¦C¼Æ 5 Ó> ±Æ¦C²Õ¦X 31 Ó
°}¦C¼Æ 6 Ó> ±Æ¦C²Õ¦X 63 Ó
Âk¯Ç°_¨Ó¬O 2 ªº N¦¸¤èÓ (N¬O°}¦C¼Æ)
¤U¦Cµ{¦¡½X¥i±Æ¦C¥X °}¦C¼Æ 6 Ó> ±Æ¦C²Õ¦X 63 Ó
½Ð±Ð¦U¦ì«e½ú ¦³¿ìªk²¤Æ¨Ã¥[¨ì°}¦C¼Æ 100 Ó¶Ü?
ÁÂÁ«ü¾É!
Option Explicit
Sub TEST_20210928_1()
Dim i&, C&, Arr, Brr, x&
Arr = Array(1, 10, 100, 1000, 10000, 100000)
ReDim Brr(0 To 1000, 1)
C = 0
On Error Resume Next
For i = 0 To UBound(Arr)
Brr(C, 0) = Arr(i)
Brr(C, 1) = "³æ¤@"
C = C + 1
Next
For i = 0 To UBound(Arr)
For x = i To UBound(Arr)
If i <> x Then
Brr(C, 0) = Arr(i) + Arr(x)
Brr(C, 1) = "2Ó¬Û¥["
C = C + 1
End If
Next
Next
For i = 0 To UBound(Arr)
For x = i To UBound(Arr)
If i <> x Then
Brr(C, 0) = Arr(i) + Arr(x) + Arr(x + 1)
Brr(C, 1) = "3Ó¬Û¥["
C = C + 1
End If
Next
For x = i To UBound(Arr)
If i <> x Then
Brr(C, 0) = Arr(i) + Arr(x) + Arr(x + 2)
Brr(C, 1) = "3Ó¬Û¥["
C = C + 1
End If
Next
For x = i To UBound(Arr)
If i <> x Then
Brr(C, 0) = Arr(i) + Arr(x) + Arr(x + 3)
Brr(C, 1) = "3Ó¬Û¥["
C = C + 1
End If
Next
For x = i To UBound(Arr)
If i <> x Then
Brr(C, 0) = Arr(i) + Arr(x) + Arr(x + 4)
Brr(C, 1) = "3Ó¬Û¥["
C = C + 1
End If
Next
For x = i To UBound(Arr)
If i <> x Then
Brr(C, 0) = Arr(i) + Arr(x + 1) + Arr(x + 2)
Brr(C, 1) = "3Ó¬Û¥["
C = C + 1
End If
Next
For x = i To UBound(Arr)
If i <> x Then
Brr(C, 0) = Arr(i) + Arr(x + 1) + Arr(x + 3)
Brr(C, 1) = "3Ó¬Û¥["
C = C + 1
End If
Next
For x = i To UBound(Arr)
If i <> x Then
Brr(C, 0) = Arr(i) + Arr(x + 1) + Arr(x + 4)
Brr(C, 1) = "3Ó¬Û¥["
C = C + 1
End If
Next
For x = i To UBound(Arr)
If i <> x Then
Brr(C, 0) = Arr(i) + Arr(x + 2) + Arr(x + 3)
Brr(C, 1) = "3Ó¬Û¥["
C = C + 1
End If
Next
For x = i To UBound(Arr)
If i <> x Then
Brr(C, 0) = Arr(i) + Arr(x + 2) + Arr(x + 4)
Brr(C, 1) = "3Ó¬Û¥["
C = C + 1
End If
Next
For x = i To UBound(Arr)
If i <> x Then
Brr(C, 0) = Arr(i) + Arr(x + 3) + Arr(x + 4)
Brr(C, 1) = "3Ó¬Û¥["
C = C + 1
End If
Next
Next
For i = 0 To UBound(Arr)
For x = i To UBound(Arr)
If i <> x Then
Brr(C, 0) = Arr(i) + Arr(x) + Arr(x + 1) + Arr(x + 2)
Brr(C, 1) = "4Ó¬Û¥["
C = C + 1
End If
Next
For x = i To UBound(Arr)
If i <> x Then
Brr(C, 0) = Arr(i) + Arr(x) + Arr(x + 1) + Arr(x + 3)
Brr(C, 1) = "4Ó¬Û¥["
C = C + 1
End If
Next
For x = i To UBound(Arr)
If i <> x Then
Brr(C, 0) = Arr(i) + Arr(x) + Arr(x + 1) + Arr(x + 4)
Brr(C, 1) = "4Ó¬Û¥["
C = C + 1
End If
Next
For x = i To UBound(Arr)
If i <> x Then
Brr(C, 0) = Arr(i) + Arr(x) + Arr(x + 2) + Arr(x + 3)
Brr(C, 1) = "4Ó¬Û¥["
C = C + 1
End If
Next
For x = i To UBound(Arr)
If i <> x Then
Brr(C, 0) = Arr(i) + Arr(x) + Arr(x + 2) + Arr(x + 4)
Brr(C, 1) = "4Ó¬Û¥["
C = C + 1
End If
Next
For x = i To UBound(Arr)
If i <> x Then
Brr(C, 0) = Arr(i) + Arr(x) + Arr(x + 3) + Arr(x + 4)
Brr(C, 1) = "4Ó¬Û¥["
C = C + 1
End If
Next
For x = i To UBound(Arr)
If i <> x Then
Brr(C, 0) = Arr(i) + Arr(x + 1) + Arr(x + 2) + Arr(x + 3)
Brr(C, 1) = "4Ó¬Û¥["
C = C + 1
End If
Next
For x = i To UBound(Arr)
If i <> x Then
Brr(C, 0) = Arr(i) + Arr(x + 1) + Arr(x + 2) + Arr(x + 4)
Brr(C, 1) = "4Ó¬Û¥["
C = C + 1
End If
Next
For x = i To UBound(Arr)
If i <> x Then
Brr(C, 0) = Arr(i) + Arr(x + 1) + Arr(x + 3) + Arr(x + 4)
Brr(C, 1) = "4Ó¬Û¥["
C = C + 1
End If
Next
For x = i To UBound(Arr)
If i <> x Then
Brr(C, 0) = Arr(i) + Arr(x + 2) + Arr(x + 3) + Arr(x + 4)
Brr(C, 1) = "4Ó¬Û¥["
C = C + 1
End If
Next
Next
For i = 0 To UBound(Arr)
For x = i To UBound(Arr)
If i <> x Then
Brr(C, 0) = Arr(i) + Arr(x) + Arr(x + 1) + Arr(x + 2) + Arr(x + 3)
Brr(C, 1) = "5Ó¬Û¥["
C = C + 1
End If
Next
For x = i To UBound(Arr)
If i <> x Then
Brr(C, 0) = Arr(i) + Arr(x) + Arr(x + 2) + Arr(x + 3) + Arr(x + 4)
Brr(C, 1) = "5Ó¬Û¥["
C = C + 1
End If
Next
For x = i To UBound(Arr)
If i <> x Then
Brr(C, 0) = Arr(i) + Arr(x) + Arr(x + 1) + Arr(x + 3) + Arr(x + 4)
Brr(C, 1) = "5Ó¬Û¥["
C = C + 1
End If
Next
For x = i To UBound(Arr)
If i <> x Then
Brr(C, 0) = Arr(i) + Arr(x) + Arr(x + 1) + Arr(x + 2) + Arr(x + 4)
Brr(C, 1) = "5Ó¬Û¥["
C = C + 1
End If
Next
For x = i To UBound(Arr)
If i <> x Then
Brr(C, 0) = Arr(i) + Arr(x + 1) + Arr(x + 2) + Arr(x + 3) + Arr(x + 4)
Brr(C, 1) = "5Ó¬Û¥["
C = C + 1
End If
Next
For x = i To UBound(Arr)
If i <> x Then
Brr(C, 0) = Arr(i) + Arr(x + 1) + Arr(x + 2) + Arr(x + 3) + Arr(x + 4)
Brr(C, 1) = "5Ó¬Û¥["
C = C + 1
End If
Next
For x = i To UBound(Arr)
If i <> x Then
Brr(C, 0) = Arr(i) + Arr(x + 1) + Arr(x + 2) + Arr(x + 3) + Arr(x + 4)
Brr(C, 1) = "5Ó¬Û¥["
C = C + 1
End If
Next
For x = i To UBound(Arr)
If i <> x Then
Brr(C, 0) = Arr(i) + Arr(x + 1) + Arr(x + 2) + Arr(x + 3) + Arr(x + 4)
Brr(C, 1) = "5Ó¬Û¥["
C = C + 1
End If
Next
Next
Brr(C, 0) = Arr(0) + Arr(1) + Arr(2) + Arr(3) + Arr(4) + Arr(5)
Brr(C, 1) = "6Ó¬Û¥["
Workbooks.Add
[A1].Resize(UBound(Arr) + 1, 1) = Application.Transpose(Arr)
[B1].Resize(UBound(Brr), 2) = Brr
[B:B].AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Columns _
("E:E"), Unique:=True
[E:E].Sort _
KEY1:=[E1], Order1:=xlAscending, _
Header:=xlGuess, OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom, SortMethod:=xlStroke, _
DataOption1:=xlSortNormal
End Sub |
|