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

[µo°Ý] ·j´M³Ì«á¤@¦C³£¦³¬Û¦P¼Æ¦rªº²Õ¦X¡C

[µo°Ý] ·j´M³Ì«á¤@¦C³£¦³¬Û¦P¼Æ¦rªº²Õ¦X¡C

¬Û¦P¼Æ¦rªº²Õ¦X.rar (99.39 KB)

»Ý¨D¡J
¥HRrngA InputBox¥ô¨ú¤@­Ó¶}¼úª©(DATA!)ªº´Á¼Æ¤Î¨ä¶ñ¤JCrngA InputBoxªºÄæ¦ì¼Æ(²ºÙA²Õ¦X)¡F
¥t¥HRrngB InputBox¥ô¨ú¤@­Ó¶}¼úª©(DATA!)ªº´Á¼Æ¤Î¨ä¶ñ¤JCrngB InputBoxªºÄæ¦ì¼Æ(²ºÙB²Õ¦X)¡F
·íA²Õ¦X©MB²Õ¦X©MA*Bªº²Õ¦X³£²Å¦X°ò¥»Å޿誺±ø¥ó¥B¤T­Ó²Õ¦X¤§¦UÅçÃÒª©ªº³Ì«á¤@¦C¤]³£¦³Åã¥Ü¬Û¦Pªº¸¹½X®É¡A«h²£¥Í®ÄªGÀɮסF§_«h¤£²£¥Í®ÄªGÀɮסC

¨ä¾l...¸Ô¦p¤W¶Ç½d¨Ò»¡©ú¡C

·q½Ð¦U¦ì¤j¤j«ü¾É¡C·P®¦~~~~~~~~~~~

¥»©«³Ì«á¥Ñ ziv976688 ©ó 2017-1-5 11:26 ½s¿è

¸É¥R»¡©ú¡J
n=2¡A2¬P¹ï2¬P©Mn=3¡A1¬P¹ï2¬P¡Fn=3¡A2¬P¹ï1¬P¡Fn=3¡A2¬P¹ï2¬Pµ¥¡J¦]¥u¦C280´Á¡A©Ò¥H§ä¤£¨ì½d¨Ò¡A½Ð¨£½Ì!

«Øij¥ý¬Ý"¤å¦r»¡©ú"¡A¦A"©Ô¥X"I_280´Á_50_273-12+268-56_2¦¸_12,42.©MI_280´Á_50_273-4+250-6_3¦¸_38.
¦pªGÁÙµLªk²z¸Ñ»Ý¨D¡A¦A"©Ô¥X"¨ä¥¦½d¨Ò¨Ó¬Ý¡CÁÂÁÂ!

¹Ï¥Ü¤¤ªº¬yµ{»¡©ú¬O¤£¤~¥H"¤H¤u¤ñ¹ï"®Éªº·Pı¡J¥ý¤ñA©MB¡A·í¨ä¦¨¥ß«á~¦A¤ñA*B¡A®Ä²v·|¤ñ¸û§Ö¡C
¦ý¦b¹q¸£¶]µ{¦¡ªº¹ê°È¤W¬°¦ó?¤p§Ì¤£²M·¡¡F©Ò¥H²Õ¦X¤ñ¹ïªº"¬yµ{¶¶§Ç"¡J½Ð ¦U¦ì¤j¤j¾ÜÀu½s¼g¡CÁÂÁÂ!

TOP

¥»©«³Ì«á¥Ñ c_c_lai ©ó 2017-1-5 20:04 ½s¿è

¦^´_ 2# ziv976688 h0 dl3d04d04
°Ñ¦Ò¬Ý¬Ý¡I
¦]§Ú¤£À´³o¹CÀ¸³W«h¡A¥u±N§Aªºµ{¦¡½X²¤¤©¸Õ¼g¡A¤£ª¾¥i§_¡H
  1. Sub Ex()
  2.     Dim startrang%, endrang%, tim!, In1rr As Variant, In2rr As Variant, StrRng$, Ncount$, Number
  3.     Dim RrngA$, Nrange$, CrngA$, RrngB$, CrngB$, i%, j%, y%, num$, Order$, NUMX$
  4.     Dim m1%, sta%

  5.     StrRng = "1"                            '  InputBox("½Ð¿é¤JDATA!¦U·j´M¤ñ¹ïªº°_©l´Á¼Æ", "¿é¤J´Á¼Æ")
  6.     Nrange = "280"                          '  InputBox("½Ð¿é¤JDATA!¦U·j´M¤ñ¹ïªº¨´¤î(¶}¼ú)´Á¼Æ", "¿é¤J´Á¼Æ")
  7.     num = "50"                              '  InputBox("½Ð¿é¤J®ÄªGÀÉA¡JH½Æ»s½d³òªº´Á¶Z¼Æ", "¿é¤J¶Z´Á¼Æ")
  8.     RrngA = "253,268,273"                   '  InputBox("½Ð¿é¤J¦U"²Ä¤@­Ó"¤ñ¹ïªº"°ò·Ç´Á¼Æ", "¿é¤J²Ä¤@­Ó´Á¼Æ")
  9.     CrngA = "1-2"                           '  InputBox("½Ð¿é¤J¦U"²Ä¤@­Ó"¤ñ¹ïªº7Äæ¨ú¥ô1~6¤§Äæ¦ì¼Æ", "¿é¤JÄæ¦ì¼Æ(1~6)")
  10.     RrngB = "249-250,263,268"               '  InputBox("½Ð¿é¤J¦U"²Ä¤G­Ó"¤ñ¹ïªº"°ò·Ç´Á¼Æ", "¿é¤J²Ä¤G­Ó´Á¼Æ")
  11.     CrngB = "1-2"                           '  InputBox("½Ð¿é¤J¦U"²Ä¤G­Ó"¤ñ¹ïªº7Äæ¨ú¥ô1~6¤§Äæ¦ì¼Æ", "¿é¤JÄæ¦ì¼Æ(1~6))
  12.     Order = ""                              '  InputBox("½Ð¿é¤J¦A¿z¿ïÅÞ¿è±ø¥óªº°_¨´§Ç¸¹", "¿é¤J§Ç¸¹(1~99)©Î¤£¼W¥[(«öEnter)")
  13.     Number = "04,12,20-22,30,34,38,42,47"   '  InputBox("½Ð¿é¤J¦U«ü©wªº¸¹½X", "¿é¤J¸¹½X(1~49)")
  14.     Ncount = "2-3"                          '  InputBox("½Ð¿é¤JÅçÃÒª©ªº³sÄò¦¸¼Æ", "¿é¤J¦¸¼Æ(2~10)")
  15.    
  16.     tim = Timer
  17.     [L1:L10] = ""
  18.     NUMX = num
  19.     Application.DisplayAlerts = False
  20.     On Error Resume Next                    '  ±N¿ù»~³B²zªº¤è¦¡³]¬°¡uÄ~Äò¤U¤@¦æ¡v¡C
  21.     Application.ScreenUpdating = False      '  ¦b­I´º¤U°õ¦æ
  22.    
  23.     '  ...............
  24.     In1rr = ToSplit(Nrange, ",")
  25.    
  26.     '  ................
  27.     In2rr = ToSplit(NUMX, ",")
  28.     '  ................
  29.       
  30.     '  .......................
  31.     [L1] = Nrange & "=" & Format((Timer - tim) / 24 / 60 / 60, "hh:mm:ss")
  32.     [L2] = "DATA!¦U·j´M¤ñ¹ïªº°_©l´Á¼Æ=" & StrRng
  33.     [L3] = "A¡JH(¶}¼úª©)ªº´Á¶Z¼Æ=" & NUMX
  34.     [L4] = "¤ñ¹ï°ò·Ç´Á¼ÆA=" & RrngA
  35.     [L5] = "Äæ¦ì¼ÆA=" & CrngA
  36.     [L6] = "¤ñ¹ï°ò·Ç´Á¼ÆB=" & RrngB
  37.     [L7] = "Äæ¦ì¼ÆB=" & CrngB
  38.     [L8] = "¼W¥[¦A¿z¿ïÅÞ¿è±ø¥óªº§Ç¸¹=" & Order
  39.     [L9] = "¦U«ü©w¦P¸¹½X=" & Number
  40.     [L10] = "ÅçÃÒª©ªº³sÄò¦¸¼Æ=" & Ncount
  41. End Sub

  42. Function ToSplit(txt As String, sp As String, Optional dash As String = "-") As String()
  43.     Dim FullNameComma As Variant, cts As Integer, nxt As Integer
  44.     Dim lf As Integer, rt As Integer, spl As String


  45.     FullNameComma = Split(txt, sp)
  46.     spl = ""
  47.     For cts = LBound(FullNameComma) To UBound(FullNameComma)
  48.         nxt = InStr(FullNameComma(cts), dash)
  49.         If nxt > 0 Then
  50.             lf = Val(Left(FullNameComma(cts), nxt - 1))
  51.             rt = Val(Mid(FullNameComma(cts), nxt + 1))
  52.             For nxt = lf To rt
  53.                 spl = IIf(spl = "", CStr(nxt), spl & sp & CStr(nxt))
  54.             Next
  55.         Else
  56.             spl = IIf(spl = "", FullNameComma(cts), spl & sp & FullNameComma(cts))
  57.         End If
  58.     Next cts
  59.    
  60.     ToSplit = Split(spl, sp)
  61. End Function
½Æ»s¥N½X

TOP

¦^´_ 1# ziv976688
¼g¤F¤@­Ó´ú¸Õµ{¦¡¡A´£¨Ñ§A¤F¸Ñ ToSplit() ªºÀ³¥Î¡G
  1. Sub Test()
  2.     Dim txt As String, sp As Variant
  3.    
  4.     txt = "249-255,263,268"
  5.     sp = ToSplit(txt, ",")
  6.     MsgBox "249-255,263,268" & vbCrLf & Join(sp, ",")
  7.    
  8.     txt = "04,12,20-22,30,34,38,42,47"
  9.     sp = ToSplit(txt, ",")
  10.     MsgBox "04,12,20-22,30,34,38,42,47" & vbCrLf & Join(sp, ",")
  11. End Sub
½Æ»s¥N½X

TOP

¦^´_ 4# c_c_lai
ÁÂÁ±zªº¤£§[«ü¾É
­«·s»¡©ú¦p¤U¡J
BASE_T-1.rar (74.91 KB)
³Æµù¡J¥N¥Î¦Wµü»¡©ú
A²Õ¦X=RrngA InputBox¥ô¨ú¤@­Ó¶}¼úª©(DATA!)ªº´Á¼Æ¤Î¨ä¶ñ¤JCrngA InputBoxªºÄæ¦ì¼Æ¡C
B²Õ¦X=RrngB InputBox¥ô¨ú¤@­Ó¶}¼úª©(DATA!)ªº´Á¼Æ¤Î¨ä¶ñ¤JCrngB InputBoxªºÄæ¦ì¼Æ¡C
n= Ncount InputBox¶ñ¤JÅçÃÒª©ªº«ü©w¦¸¼Æ¡C
I = Number InputBox¶ñ¤J«ü©wªº¸¹½X¡C

³q«h¡J
RrngAªº´Á¼Æ¡ÕNrange´Á¼Æ¤~¦³®Ä¡ã°õ¦æ¡C
Rrng¢Ðªº´Á¼Æ¡ÕRrngA´Á¼Æ¤~¦³®Ä¡ã°õ¦æ¡C
·j´Mªº½d³ò=¥ÑStrRng InputBox¶ñ¤Jªº¦U´Á¼Æ¨ìNrange InputBox¶ñ¤Jªº¦U´Á¼Æ¬°¤î¡C

°ò¥»ÅÞ¿è¡J
¥HA²Õ¦X©ÎB²Õ¦X©ÎA*BªºÂù²Õ¦X~¦b·j´Mªº½d³ò¤º~
¥Ñ¨ä°ò·Ç¦C©¹¤W·j´M²Ä1­Ó¨ì²Än­Óªº¬Û¦P²Õ¦X(§YÅçÃÒª©)¡A
·í¸Ó²Õ¦Xªº²Ä1­Ó¨ì²Än­Óªº¬Û¦P²Õ¦X¤§³Ì«á¤@¦C(=Nrange´Á¼Æªº¹ïÀ³´Á¼Æ)~
³£¦³Åã¥Ü¥ô¤@­Ó(§t)¥H¤WªºI®É¡A«hÅÞ¿è±ø¥ó¦¨¥ß¡C

»Ý¨D¡J²£¥Í®ÄªGÀɤΨäSheet1®æ¦¡¤º®e¡C
1.·íA²Õ¦X©MB²Õ¦X©MA*BªºÂù²Õ¦Xµ¥³£²Å¦X°ò¥»Å޿誺±ø¥ó~¥B
¤T­Ó²Õ¦X¤§¦UÅçÃÒª©ªº³Ì«á¤@¦C(=Nrange´Á¼Æªº¹ïÀ³´Á¼Æ)¤]³£¦³Åã¥Ü¬Û¦PªºI®É¡A«h²£¥Í®ÄªGÀɮסC

2.¦WºÙ
Á`¸ê®Æ§¨¡JI_Nrange´Á_NUM_ RrngA _ CrngA¬P+RrngA _ CrngA¬P_ Ncount¦¸_ Number

¤À¸ê®Æ§¨¦WºÙ©M®ÄªGÀɮצWºÙ©M®ÄªGÀÉ®×Sheet1ªº¤º®e&®æ¦¡~~~~~~~~~~~
¸Ô¦p¦U½d¨ÒÀɪº¹Ï¥Ü©M»¡©ú¡CÁÂÁÂ!

TOP

¦^´_ 4# c_c_lai
¬Ý³o¼Ë¦æ¤£¦æ~~~~






¥H¤W¬°1¬P_1¬P_2¦¸ªº¹Ï¥Ü~~
¹Ï¥Ü1~3=·j´MÅ޿誺¤À¸Ñ»¡©ú¡C
©Ô¥­¹Ï»¡=¶}¼úª©&3­Ó ²Õ¦XªºÅçÃÒª©ªº¹ïÀ³´Á¼Æ©Ô¥­»ô«áªº¹Ï¥Ü©M­«ÂI»¡©ú¡C
Sheet1=¬°  I_28´Á_15_24-3+20-5_2¦¸_3,11,21,49 ®ÄªGÀɮתº¤º®e©M¤u§@ªí®æ¦¡¡C

¨ä¾l 1_1¬P_3¦¸¡F 1_2¬P_2¦¸¡F 1¬P_2¬P_3¦¸¡F 2¬P_1¬P_2¦¸¡F2¬P_1¬P_3¦¸¡F2¬P_2¬P_2¦¸¡F2¬P_2¬P_3¦¸
±¡¸Ô¨£¤W¶Ç½d¨Ò¡C

PS:BASE_T-1(MF)ªºDATA¶}¼úªí¬°¼ÒÀÀ¸ê®Æ¡C

TOP

¦^´_ 6# ziv976688
    '  22 ~ 26  ¡G  21 (4)¡B11 (3)¡B2 (2)¡B26 (2)¡B 38 (2)¡B 43 (2)¡B 46 (2)
    '  20 ~ 24  ¡G  21 (4)¡B2 (3)¡B12 (2)¡B14 (2)¡B 30 (2)¡B 46 (2)¡B 17 (1)
    '  45 ~ 51  ¡G  11 (3)¡B34 (2)¡B6 (2)¡B41 (2)¡B 49 (2)¡B 22 (2)¡B 30 (2)
³o¤TºØ²Õ¦X¡A¸ò§A­nªº¼Æ¾Ú¦³©Ò®t¶Z¶Ü¡H

TOP

¥»©«³Ì«á¥Ñ ziv976688 ©ó 2017-1-9 10:56 ½s¿è

¦^´_ 7# c_c_lai
±z¬O»¡«ü©w¸¹½Xªº½d³ò¶Ü?
Number InputBox  «ü©w¸¹½Xªº½d³ò¬O±q01~49§@¥ô·N¿ï¾Ü:
EX:1,3,5´N¬O¦pªG¦U²Õ¦X(§YA²Õ¦X,B²Õ¦X,A*B²Õ¦X)ªº³Ì«á¤@¦C³£¦³Åã¥Ü01©Î03©Î05ªº¥ô¤@­Ó(§t)¥H¤Wªº«ü©w¸¹½X§Y¦¨¥ß¡C
EX:1-3,10-15´N¬O¦pªG¦U²Õ¦Xªº³Ì«á¤@¦C³£¦³Åã¥Ü01©Î02©Î03©Î10©Î11©Î12©Î13©Î14©Î15ªº¥ô¤@­Ó(§t)¥H¤Wªº«ü©w¸¹½X§Y¦¨¥ß¡C
EX:10-15,23,38,47-49´N¬O¦pªG¦U²Õ¦Xªº³Ì«á¤@¦C³£¦³Åã¥Ü11©Î12©Î13©Î14©Î15©Î23©Î38©Î47©Î48©Î49ªº¥ô¤@­Ó(§t)¥H¤Wªº«ü©w¸¹½X§Y¦¨¥ß¡C
EX:1-49´N¬O¦pªG¦U²Õ¦Xªº³Ì«á¤@¦C³£¦³Åã¥Ü01~49ªº¥ô¤@­Ó(§t)¥H¤Wªº«ü©w¸¹½X§Y¦¨¥ß¡C
©Ò¥H~
½d¨Ò¥DÀÉ(BASE_T-1(MF))ªº«ü©w¸¹½X(Number) = "3,11,21-26,43,49"
§Y¬O¦pªG¦U²Õ¦Xªº³Ì«á¤@¦C³£¦³Åã¥Ü03©Î11©Î21©Î22©Î23©Î24©Î25©Î26©Î43©Î49ªº¥ô¤@­Ó(§t)¥H¤Wªº«ü©w¸¹½X§Y¦¨¥ß¡C

ÁÙ¬O±z¬O»¡¤ñ¹ïªº°ò·Ç´Á¼Æ½d³ò¶Ü?
RrngA = "21-24"  «üA°ò·Ç´Á¼Æ21´Á¨ì24´Á
RrngB = "18-21" «üB°ò·Ç´Á¼Æ18´Á¨ì21´Á
RrngA>RrngB ¤~°õ¦æ¡F©Ò¥H
A²Õ¦X°ò·Ç´Á¼Æ  21´Á, 22´Á, 23´Á, 24´Á
B²Õ¦X°ò·Ç´Á¼Æ 18´Á,19´Á, 20´Á, 21´Á
A²Õ¦X°ò·Ç´Á¼Æ*B²Õ¦X°ò·Ç´Á¼Æªº¤ñ¹ï´Á¼Æ¦³21*18,21*19,21*20¡F22*18,22*19,22*20,22*21¡F23*18,23*19,23*20,23*21,23*22¡F24*18,24*19,24*20,24*21,24*22,24*23

=============================================================================================================
   '  22 ~ 26  ¡G  21 (4)¡B11 (3)¡B2 (2)¡B26 (2)¡B 38 (2)¡B 43 (2)¡B 46 (2)
    '  20 ~ 24  ¡G  21 (4)¡B2 (3)¡B12 (2)¡B14 (2)¡B 30 (2)¡B 46 (2)¡B 17 (1)
    '  45 ~ 51  ¡G  11 (3)¡B34 (2)¡B6 (2)¡B41 (2)¡B 49 (2)¡B 22 (2)¡B 30 (2)
¤£¤ÓÀ´ 21 (4)¡B11 (3)¡B2 (2)¤¤ªº (4),(3),(2)ªº·N«ä?
¬O«ü22´Á¨ì26´Á¤§¶¡¡A21¥X²{4¦¸¡F11¥X²{3¦¸¡F02¥X²{2¦¸?

´Á¶¡¬Y¸¹½X¥X²{´X¦¸»P»Ý¨DµLÃö^^

TOP

¥»©«³Ì«á¥Ñ c_c_lai ©ó 2017-1-9 11:12 ½s¿è

¦^´_ 8# ziv976688
¬O«ü22´Á¨ì26´Á¤§¶¡¡A21¥X²{4¦¸¡F11¥X²{3¦¸¡F02¥X²{2¦¸¡C

¦Ü©ó
(¤@) «ü©w¸¹½Xªº½d³ò
     ¬O«ü "A°ò·Ç´Á¼Æ21´Á¨ì24´Á" ªº ²Ä 24 ´Á¦æ¤¤¡A¦³¥X²{ "«ü©w¸¹½X"¡H

(¤G) A°ò·Ç´Á¼Æ*B°ò·Ç´Á¼Æ¤ñ¹ïªº´Á¼Æ
     ¦³21*18,21*19,21*20¡F
     22*18,22*19,22*20,22*21¡F23*18,23*19,23*20,23*21,23*22¡F
     24*18,24*19,24*20,24*21,24*22,24*23
     ¤£¤Ó©ú¥Õ¡A21*18 ¡A . . . . .  µ¥µ¥¬O¦ó¸q¡H

TOP

¦A¸É¥R:
CrngA=1-2¡Fªí¥ÜA²Õ¦X°ò·Ç´Á¼Æ ªº7­ÓÄæ¦ì¥ô¨ú¨ä¤¤ªº1­ÓÄæ¦ì©M¥ô¨ú¨ä¤¤ªº2­ÓÄæ¦ìªº¤£­«½Æ²Õ¦X¡C
§Y1,2,3,4,5,6,7©M12.13,14,15,16,17,23,24,25,26,27,34,35,36,37,45,46,47,56,57,67µ¥¦@28­Ó¦PÄæ¦P¸¹ªº²Õ¦X¡C

CrngA=1-3¡Fªí¥ÜA²Õ¦X°ò·Ç´Á¼Æ ªº7­ÓÄæ¦ì¥ô¨ú¨ä¤¤ªº1­ÓÄæ¦ì©M¥ô¨ú¨ä¤¤ªº2­ÓÄæ¦ì©M¥ô¨ú¨ä¤¤ªº3­ÓÄæ¦ìªº¤£­«½Æ²Õ¦X¡C
§Y1,2,3,4,5,6,7©M12.13,14,15,16,17,23,24,25,26,27,34,35,36,37,45,46,47,56,57,67¡F123,124,125,126,127,134,135,136,137,145,146,147,156,157,167¡F234,235,236,237,...567¡Fµ¥¦@63­Ó¦PÄæ¦P¸¹ªº²Õ¦X¡C
¨ä¾l1-4,1-6,2-3,2-4,2-5,2-6,....,5-6,1,2,3,4,5,6Ãþ±À¡C

CrngB=1-2¡Fªí¥ÜB²Õ¦X°ò·Ç´Á¼Æ ªº7­ÓÄæ¦ì¥ô¨ú¨ä¤¤ªº1­ÓÄæ¦ì©M¥ô¨ú¨ä¤¤ªº2­ÓÄæ¦ìªº¤£­«½Æ²Õ¦X¡C
§Y1,2,3,4,5,6,7©M12.13,14,15,16,17,23,24,25,26,27,34,35,36,37,45,46,47,56,57,67µ¥¦@28­Ó¦PÄæ¦P¸¹ªº²Õ¦X¡C

CrngA=1-3¡Fªí¥ÜA²Õ¦X°ò·Ç´Á¼Æ ªº7­ÓÄæ¦ì¥ô¨ú¨ä¤¤ªº1­ÓÄæ¦ì©M¥ô¨ú¨ä¤¤ªº2­ÓÄæ¦ì©M¥ô¨ú¨ä¤¤ªº3­ÓÄæ¦ìªº¤£­«½Æ²Õ¦X¡C
§Y1,2,3,4,5,6,7©M12.13,14,15,16,17,23,24,25,26,27,34,35,36,37,45,46,47,56,57,67¡F123,124,125,126,127,134,135,136,137,145,146,147,156,157,167¡F234,235,236,237,...567¡Fµ¥¦@63­Ó¦PÄæ¦P¸¹ªº²Õ¦X¡C
¨ä¾l1-4,1-6,2-3,2-4,2-5,2-6,....,5-6,1,2,3,4,5,6Ãþ±À¡C

TOP

        ÀR«ä¦Û¦b : ¡i®É¤é²öªÅ¹L¡j¤@­Ó¤H¦b¥@¶¡°µ¤F¦h¤Ö¨Æ¡A´Nµ¥©ó¹Ø©R¦³¦hªø¡C¦]¦¹¥²¶·»P®É¶¡Ävª§¡A¤Á²ö¨Ï®É¤éªÅ¹L¡C
ªð¦^¦Cªí ¤W¤@¥DÃD