¶]¤F¤@¬q®É¶¡¤§«á´N·|¥X²{°O¾ÐÅ餣¨¬,·Q°Ý¤@¤U,¦³þÃäÁÙ¥i¥H¥[¤JÄÀ©ñ°O¾ÐÅ骺µ{¦¡½X?
ÁÙ¬O¦³þ¤@¬qµ{¦¡½X¼gªº¤£¦n,¦û¥Î¤F¤Ó¦h°O¾ÐÅé¶Ü?- Sub «ö¶s§Î2_Click() '7*6
- Application.ScreenUpdating = False '¿Ã¹õ
- rrr = Range("BG7")
- If rrr = "" Then MsgBox "©|¥¼¿é¤J°_©l¦C¼Æ!": Exit Sub
- '¨ú¥X³sÄò³z¤ä¼Æ
- losetime = Sheets("7x6").[c7]
- If losetime < 0 Then MsgBox "³z¤ä¤£¥i¬°t¼Æ!": Call after: Exit Sub
- t1 = Hour(Now()) * 3600 + Minute(Now()) * 60 + Second(Now())
- Dim ar, TestArray() As String, br(), x&, y&, z&, n&, rng2, win_num, aa()
- win_num = 0 '³Ì«á¦¨¥\¬ö¿ýªº²Õ¼Æ
- '²M°£BAÄæ¸ê®Æ
- Sheets("7x6").Columns("Bt:Bt").ClearContents
- Sheets("data").Columns("af:bu").ClearContents
- 'Àˬddata¤À¶¦³´Xµ§¸ê®Æ
- num1 = WorksheetFunction.CountA(Sheets("data").Range("K:K")) / 7
- If num1 < 2 Then MsgBox "¸ê®Æ¤£¨¬°÷!": Exit Sub
- '«Ø¥ßdata¤À¶ªº°}¦C
- Rng = Sheets("data").[w1].Resize(num1 * 8, 1)
- '¨ú¥X¬ÕÁ«°}¦C
- earn = Sheets("7x6").Range("bg" & rrr).Resize(ED("bg", , "7x6") - rrr + 1, 1).Value
-
-
- '±N°ò¥»±Æ§Ç¿é¤J°}¦C
- ReDim ar(1 To num1, 1 To 1)
- For i = 1 To num1
- ar(i, 1) = Rng((i - 1) * 8 + 1, 1)
- Next
- Dim D As Object
- Set D = CreateObject("SCRIPTING.DICTIONARY") '¦r¨åª«¥ó
- '¶]¥X±Æ¦C²Õ¦X---------------------------------------------------
- For y = x + 1 To UBound(ar) - 1
- For z = y + 1 To UBound(ar)
- 'Àˬd¤»Ó¤¸¯À¤º®e¬O§_¦³«½Æ
- reallyname = ar(y, 1) & "_" & ar(z, 1)
- temp = Split(reallyname, "_")
- For i = 0 To 5
- If Not D.Exists(CStr(temp(i))) Then
- D.Add CStr(temp(i)), i
- Else
- D.RemoveAll: GoTo fn2
- End If
- Next
- D.RemoveAll
- n = n + 1
- ReDim Preserve br(1 To 2, 1 To n)
- br(1, n) = ar(y, 1)
- br(2, n) = ar(z, 1)
- fn2: Next
- Next
- Set D = Nothing
- Set ar = Nothing
- If n = 0 Then MsgBox "¸g¹L²¾°£«½Æªº²Õ¦X¤§«á,¨S¦³¥ô¦ó¤@²Õ¥i¥H¦X¦¨7*7*6": Exit Sub
- br = Application.Transpose(br)
- ReDim rng2(1 To 7, 1 To 42)
- '±N²Õ¦X«áªº¤º®e¿é¤J¦Ü°}¦C¤º---------------------------------------------------
- '¶]¨C¤@µ§¥¼¨Óªº±Æ¦C²Õ¦X
- Rng = Sheets("data").[w1].Resize(num1 * 8, 1)
- For i = 1 To UBound(br)
- '¶]2Ó²Õ¦X
- For j = 1 To 2
- '¶]¨C¤@µ§ì¥»ªº²Õ¦X
- For K = 1 To UBound(Rng) Step 8
- '§PÂ_쥻²Õ¦Xªº¥N½X,¬O§_²Å¦X±Æ¦C²Õ¦X¤§«áªº¥N½X
- If CStr(Rng(K, 1)) = CStr(br(i, j)) Then
- '«Ø¥ß쥻ªº°}¦C
- org_rng = Sheets("data").Range("J" & K + 1).Resize(7, 21)
- '§ä¨ì¥N½X¤§«á,±N쥻ªº°}¦C¤º®e¿é¤J¦Ü·sªº±Æ¦C²Õ¦X°}¦C¤º
- For L = 1 To 7
- For M = 1 To 21
- 'L¬O1~7ªº¦C¼Æ,M¬OÄæ¼Æ,K¬O¸Ó½s¸¹ªº¦C¼Æ¦ì¸m
- rng2(L, M + (j - 1) * 21) = CStr(org_rng(L, M))
- Next
- Next
- Exit For
- End If
- Next
- Next
- '¨C¶]§¹¤@Ó§¹¾ãªº7*21²Õ¦X,´N§â¸ê®Æ©ñ¨ì7*3¤À¶¸Ì±¶i¦æ¤ñ¹ï-----------------------------
- '©ñ¸m¸ê®Æ
- Sheets("7x6").[I9].Resize(7, 42).Value = rng2
- '¶]¨C¤@µ§¬ÕÁ«
- x = 0 '¥Î¨Ópºâ³sÄò´Xµ§³z¤ä
- For j = 1 To UBound(earn)
- If earn(j, 1) = "" Then GoTo fn
- If earn(j, 1) >= 0 Then: x = 0: GoTo fn
- x = x + 1
- If x = losetime Then GoTo f1 '¨ì¹F³z¤ä¼Ð·Ç=>¤£¤©¬ö¿ý,°õ¦æ¤U¤@Ó²Õ¦X
- fn: Next
- '¥i¥H°õ¦æ¨ì³oÃä,¥Nªí³z¤ä¼Æ¶q¨S¦³¶W¹L,»Ýn¬ö¿ý½s¸¹²Õ¦X¨ì[ba]¦ì¸m
- win_num = win_num + 1 '¦¨¥\ªº¦¸¼Æ
- Sheets("7x6").Range("Bt" & win_num).Value = win_num & "--" & br(i, 1) & "_" & br(i, 2)
- Sheets("data").Range("as" & (win_num - 1) * 8 + 1).Value = br(i, 1) & "_" & br(i, 2)
- Sheets("data").Range("af" & (win_num - 1) * 8 + 1).Value = win_num
- Sheets("data").Range("af" & (win_num - 1) * 8 + 2).Resize(7, 42).Value = rng2
- f1: Next
- T2 = Hour(Now()) * 3600 + Minute(Now()) * 60 + Second(Now())
- MsgBox win_num & "/" & UBound(br) & "(²Õ)¦@¯Ó®É " & T2 - t1 & " ¬í"
- End Sub
½Æ»s¥N½X |