ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ¹B°Ê·|ÄvÁɹD¦¸ÀH¾÷¤À²Õ

[µo°Ý] ¹B°Ê·|ÄvÁɹD¦¸ÀH¾÷¤À²Õ

¦b¤U¥X²{¤@­Ó°ÝÃD¡A§Æ±æ¤j®a¯àÀ°;¦£¡G

100M¤ñÁɤ¤¡A¤@¦@¤E­Ó¯Z¯Å¡A¨C¯Z¤G­Ó¤H°Ñ¥[¡A·QÀH¾÷¤À¦¨¤T²Õ¡A¨C²Õ¤»¤H¡A²{±¡ªp¬O¡G

¤@¡B¦P¯Z¤£¯à¤À¦b¦P¤@²Õ§O

¤G¡B¨C¯Zªº¤H¤£¯à¤À¦b¦P¤@¹D¦¸

³Â·Ð½Ð¤j®a¯à¤©¥H¨ó§U¡A·PÁ¡I

¹B°Ê·|¤À²Õªí.zip (10.5 KB)

~¬Q¤éºØºØ¡AÄ´¦p¬Q¤é¦º~
~¤µ¤éºØºØ¡AÄ´¦p¤µ¤é¥Í~

¥»©«³Ì«á¥Ñ Andy2483 ©ó 2023-2-17 10:02 ½s¿è

¦^´_ 32# ymes
¦^´_ 19# ­ã´£³¡ªL


    ¦A¦¸ÁÂÁ«e½úµoªí¦¹¥DÃD,ÁÂÁ ­ã´£³¡ªL«e½ú«ü¾É
«á¾Ç¾Ç²ß¤½¦¡ªº¤ß±o,½Ð«e½ú°Ñ¦Ò«ü¾É,ÁÂÁÂ

¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

¦^´_ 32# ymes


    ®¥³ß«e½ú±À®i¶¶§Q
½Ð«e½ú±`µoªí·s¥DÃD,¥H«Ú¸É¹ï«á¾Çªº¶Ë®`,ÁÂÁ«e½ú
¤@°_¾Ç²ß
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

¦^´_ 31# Andy2483


©êºp¡A¬O¯uªº¤£·|­×§ïvba¡A©Ò¥H«áÄò·Q»¡½ÐÀ°¦£§ï°Ê¤@¨Ç¤p¦a¤è¡A

§Æ±æ¤é«á¦³§ó°Ê®É¡A¥i¥H¦Û¦æ­×§ï¡A

¨S·Q¨ìÅܦ¨±zªº§xÂZ¡K¡Ksorry

¤£¹L¡A«áÄò¾aµÛ±zªºÀ°¦£¤Î¤½¦¡¡A¤w§¹¦¨¦h¶µÄvÁɪí³æ¡A¦A¦¸»¡Án·PÁ¡I:lol :lol :lol
~¬Q¤éºØºØ¡AÄ´¦p¬Q¤é¦º~
~¤µ¤éºØºØ¡AÄ´¦p¤µ¤é¥Í~

TOP

¦^´_ 29# ymes


    ÁÂÁ«e½ú¦^´_
1.¾ÇµL¤îºÉ,ÁöµM¦³ÂI³Q«e½ú­Aªº·Pı,«á¾Ç¥Ì¤§¦p¹~,»@«e½úÄ~Äòµoªí¨ä¥L¥DÃDµ¹«á¾Ç­Ì°µ¾Ç²ß
2. ­ã´£³¡ªL«e½úªº°ª²`¦^µª,«á¾Ç¤]ÁÙ¤@ª¾¥b¸Ñ,½Ð«e½ú±`¤W½×¾Â¤@°_¾Ç²ß
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

¦^´_ 24# ­ã´£³¡ªL


ÁÂÁ¤j¤jªº´£¿ô¡A¤é«á¥H¦Û¤v¼ô±xªº¤½¦¡¬°¥D¡A

°µ¦Û¤vÀ´ªº¨Æ¤]¸û¦w¥þ¡A·PÁ¡I
~¬Q¤éºØºØ¡AÄ´¦p¬Q¤é¦º~
~¤µ¤éºØºØ¡AÄ´¦p¤µ¤é¥Í~

TOP

ÁÂÁ¤G¦ì¤j¯«À°¦£¡A¨ä¹ê¦b²Ä¤K¼Ó´N¤w¸g¸Ñ¨M¦b¤U°ÝÃD¤F¡A
¹ê¦b¬O¤£·|­×§ïVBA¡A©Ò¥H´N¤£Â_µo°Ý¡A
·QÂǥѤp³¡¥÷­×§ï¬Ý¥X¤é«á¥i¯à§ï°Êªº¦a¤è¡A
®í¤£ª¾³y¦¨±ý¸Ñ¨MªÌªº§xÂZ¡A¯uªº«Ü©êºp¡A
¦A¸òºô¸ô¤WÀ°¦£ªº¤H»¡Án·PÁ¡A¦³¤F±z­Ì¼ö¤ßªºÀ°¦£¡AÅý§Ú¯à¶¶§Q§¹¦¨ªí³æ¡A·PÁ¡I
~¬Q¤éºØºØ¡AÄ´¦p¬Q¤é¦º~
~¤µ¤éºØºØ¡AÄ´¦p¤µ¤é¥Í~

TOP

¦^´_ 27# ­ã´£³¡ªL


    ÁÂÁ«e½úªº«ä¸ô¸ÑªR«ü¾É,«á¾Ç§V¤O´ú¸Õ»â®©¤¤,ÁÂÁ«e½ú´£Äâ
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

¦^´_ 26# Andy2483

¥H¤U¬O"«ä¸ô"¸ÑªR///
TC = Left(123456789, [k3])  '¥H¶]¹D¼Æ¨ú¼Æ¦r¦ê...¶]¹D¦³6--¹D¦¸¦r¦ê= 123456, ¦³8«h= 12345678
For j = 1 To [k5] - 1: xD(j) = TC: Next '¦U²Õ³£¹w¥ý¸m¤J¹D¦¸¦r¦ê
xD(j) = Left(TC, [k4] - ([k5] - 1) * [k3]) '³Ì«á¤@²Õ...­Y¥u¦³4¤H...«h¸m¤J 1234

V = Arr(i, 4): TV = xD(V)  ' ¨ú¥X¦U²Õªº¹D¦¸¦r¦ê(¥¦¸g¹L¶Ã¼Æ¨ú¼Æ«á, ·|¦³ÅܤÆ...¦r¤¸¼Æ»¼´î)

For i = R - 1 To 1 Step -1 '¤Ï¦V°j°é...Åý³Ì«á¤@²ÕÀu¥ý¦û¥Î1 ~ ? ¶]¹D, ¤~¤£·|¦³¶¡¹j

X = Val(Mid(TV, Int(Rnd * Len(TV)) + 1, 1))  'ÀH¾÷±q¸Ó²Õ"¹D¦¸¦r¦ê"¤¤¨ú¥X¤@­Ó¼Æ¦r
If xD(T & "/" & X) = 0 Then Exit Do '¥H[¯Z¯Å+¹D¦¸]Àˬd, µ¥©ó0...ªí¥Ü¸Ó¯Z¯Å©|¥¼¦û¥Î¸Ó¶]¹D..¦X®æ..¸õ¥X//§_«h­«·s¨ú¼Æ

xD(V) = Replace(TV, X, "") '¦¹¦¸¨ú¥Xªº¹D¦¸¼Æ¦r...¶·±q¹D¦¸¦r¦ê¤¤­ç°£...¤U¦¸´N¤£·|¦³³o­Ó¼Æ¦r(¦r¦ê¨C¶]¤@¦¸, ´î¤Ö¤@­Ó¼Æ)
xD(T & "/" & X) = 1  '[¯Z¯Å&¹D¦¸]°O¼Æ¬°1, ªí¥Ü¸Ó¯Z¯Å¤w¦û¥Î¤F¸Ó¶]¹D(¤U¦¸±Æ°£¥Î)


===========================

TOP

¦^´_ 19# ­ã´£³¡ªL


    ÁÂÁ«e½ú«ü¾É,«á¾Ç¾q¶w,³o¤ÓÃø¤F
«á¾Çµ{«×¥u¯à¤j·§ª¾¹Dµ{¦¡½X·N«ä,¨äÅÞ¿è·N¸q¤ÓÃø¤F,«á¾ÇÄ~Äò¾Ç²ß,§Æ±æ¦³¤Ñ¯à¶}¬¬ÝÀ´

Sub B_¶}©l¤À²Õ()
Dim Arr, xD, R&, N&, i&, T$, TC$, TV$, X%, V%, Nx%, j%
'¡ô«Å§iÅܼÆ!(Arr,xD)¬O³q¥Î«¬ÅܼÆ,(R,N,i)¬Oªø¾ã¼ÆÅܼÆ,(T,TC,TV)¬O¦r¦êÅܼÆ,¨ä¥L¬Oµu¾ã¼ÆÅܼÆ
[k6] = ""
'¡ô¥O[K6]Àx¦s®æ­È¬OªÅ¦r¤¸
Call ­«¸m¸ê®Æ
'¡ô°õ¦æ(­«¸m¸ê®Æ)°Æµ{¦¡
R = [m65536].End(3).Row
'¡ô¥OR³oªø¾ã¼ÆÅܼƬO MÄæ³Ì«á¤@­Ó¦³¤º®eÀx¦s®æ¦C¸¹
If R < 2 Then MsgBox "¡¯©|¥¼¸ü¤J¸ê®Æ¡I¡@": Exit Sub
'¡ô¦pªGRÅÜ¼Æ < 2 !´N¸õ¥X´£¥Üµ¡~~,«ö½T»{«á§Yµ²§ôµ{¦¡°õ¦æ
Set xD = CreateObject("Scripting.Dictionary")
'¡ô¥OxD¬O ¦r¨å
Re_Try:
'¡ôµ{§Ç¦ì¸mÃѧO
Nx = Nx + 1
'¡ô¥ONx³oµu¾ã¼ÆÅܼƲ֥[ 1
If Nx > 10 Then MsgBox "¡¯°õ¦æ¤À²Õ¦h¦¸µLµ²ªG¡I½Ð­«¸Õ©ÎÀˬd¸ê®Æ¬O§_¥¿½T¡I¡@": Exit Sub
'¡ô¦pªGNxÅÜ¼Æ > 10!´N¸õ¥X´£µøµ¡~~,«ö½T»{«á§Yµ²§ôµ{¦¡°õ¦æ
xD.removeall
'¡ô¥OxD¦r¨å²MªÅ
TC = Left(123456789, [k3])
'¡ô¥OTC³o¦r¦êÅܼƬO 123456789¦r¦êªº¥ª°¼ [k3]­È­Ó¦r
For j = 1 To [k5] - 1: xD(j) = TC: Next
'¡ô³]¶¶°j°éj±q1¨ì [k3]­È(¶]¹D¼Æ)-1 :¥O¥HjÅܼƷíkey,item¬O TCÅܼÆ,¯Ç¤J xD¦r¨å¸Ì
xD(j) = Left(TC, [k4] - ([k5] - 1) * [k3])
'¡ô¥OjÅܼƷíkey,item¬O TCÅܼƥª°¼ªº [k4] - ([k5] - 1) * [k3]­Ó¦r
'=¤H¼Æ - (²Õ¼Æ - 1)­¼¤W ¶]¹D¼Æ

Randomize
'¡ô¤£©T©w¶Ã¼Æªì©l­È
Arr = Range("m2:p" & R)
'¡ô¥OArr³o³q¥Î«¬ÅܼƬO¤Gºû°}¦C,¥H[M2]¨ì PÄæ²Ä RÅܼƦC½d³ò,
'³o½d³òÀx¦s®æ­È­Ë¤J°}¦C¤¤

For i = R - 1 To 1 Step -1
'¡ô³]°f°j°éi±q RÅܼÆ-1 ¨ì1 ,¥O¨C¦¸°j°éÅýi -1
    T = Arr(i, 1)
    '¡ô¥OT³o¦r¦êÅܼƬO iÅܼƦC²Ä1ÄæArr°}¦C­È
    N = 0
    '¡ô¥ON³oªø¾ã¼ÆÅܼƬO 0
    V = Arr(i, 4)
    '¡ô¥OV³oµu¾ã¼ÆÅܼƬO iÅܼƦC²Ä4ÄæArr°}¦C­È
    TV = xD(V)
    '¡ô¥OTV³o¦r¦êÅܼƬO ¥HVÅܼƷíkey¬dxD¦r¨å¦^¶Çªºitem­È
    Do
    '¡ô³]µL­­°j°é! »Ý­n·Q¿ìªk¸õ¥X°j°é!
       X = Val(Mid(TV, Int(Rnd * Len(TV)) + 1, 1))
       '¡ô¥OX³oµu¾ã¼ÆÅܼƬO Val¨ç¦¡¦^¶Çªº¼Æ¦r,
       '¨ç¦¡¤º®e:TVÅܼƱq Int(Rnd * Len(TV)) + 1 ­Ó¦r¶}©l,¨ú1­Ó¦r
       '¶Ã¼Æ ­¼ TVÅܼƪº¦r¤¸¼Æ«á,¥h°£¤p¼Æ,³Ì«á +1

       If xD(T & "/" & X) = 0 Then Exit Do
       '¡ô¦pªG¥H TÅܼƳs±µ "/" ²Å¸¹¦A³s±µ XÅܼƷíkey¬d xD¦r¨å¦^¶Çitem­È¬O 0??
       '¦pªG¬O 0,´N¸õ¥X°j°é

       N = N + 1
       '¡ô¥ONÅܼƲ֥[ 1
       If N >= 200000 Then GoTo Re_Try
       '¡ô¦pªGNÅÜ¼Æ N >= 200000!,´N¸õ¨ì Re_Try¼Ð¥Ü¦ì¸mÄ~Äò°õ¦æ
    Loop
    xD(V) = Replace(TV, X, "")
    '¡ô¥O¥HVÅܼƷíkey,item¬O(TVÅÜ¼Æ ±NXÅܼƥHªÅ¦r¤¸¸m´«)«áªº¦r¦ê,¯Ç¤JxD¦r¨å
    xD(T & "/" & X) = 1
    '¡ô¥O¥HTÅܼƳs±µ "/" ¦A³s±µ XÅܼƪº·s¦r¦ê·íkey,item¬O 1,¯Ç¤JxD¦r¨å
    Arr(i, 3) = X
    '¡ô¥Oi°j°é¦C²Ä3ÄæArr°}¦C­È¬O XÅܼÆ
Next i
With [m2].Resize(R - 1, 4)
'¡ô¥H¤U¬O[M2]ÂX®i¦V¤U R - 1¦C,¦V¥k 4Äæ½d³òÀx¦s®æªºµ{§Ç
     .Value = Arr
     '¡ô¥O³o½d³òÀx¦s®æ­È¥HArr°}¦C­È­Ë¤J
     .Sort Key1:=.Item(4), Order1:=xlAscending, _
           Key2:=.Item(3), Order2:=xlAscending, Header:=xlNo
     '¡ô¥O¸ê®Æ¥HPÄæ°µ¨S¦³¼ÐÃD¦Cªº¶¶±Æ§Ç,¦P®É°µ²Ä¤G¼hOÄ涶±Æ§Ç
End With
Application.ScreenUpdating = True: [k6] = "OK"
'¡ô¥O¿Ã¹õ«ì´_ÅܤÆ: ¥O[k6] Àx¦s®æ­È¬O "OK" ¦r¦ê
MsgBox "¡ã¤À²Õ§¹¦¨¡ã¡@"
'¡ô¸õ¥X´£¥Üµ¡~~
End Sub
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

        ÀR«ä¦Û¦b : ¥¬¬I¦p¼½ºØ¡A¥HÅw³ß¤ß´þ¼íºØ¤l¡A¤~·|µoªÞ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD