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

[µo°Ý] ¥u¿é¤J²µu¤å¦r©Î¼Æ¦r,¥H¦WºÙ©Î±b¸¹¬d¸ß

[µo°Ý] ¥u¿é¤J²µu¤å¦r©Î¼Æ¦r,¥H¦WºÙ©Î±b¸¹¬d¸ß

¥u¿é¤J²µu¤å¦r©Î¼Æ¦r,¥H¦WºÙ©Î±b¸¹¬d¸ß

°ÝÃD¦p¤U:
¤µ¦]±b¸¹¤j³¡¤À«e10½X¬°¬Û¦P¼Æ¦r
¥H¼Ò½k¬d¸ß¤è¦¡¨Ò¦p¦b  Q8Àx¦s®æ¥H¼Æ¦r¤è¦¡¿é¤J±b¸¹   1020
Q9-Q51Àx¦s®æ½d³òÅã¥Ü§t¦³  1020 ¤§¼Æ¾Ú¥þ³¡Åã¥Ü(­Y¬Oµ§¼Æ¦h¸û¦³°ÝÃD...)
¸Ó¦p¦ó­×¥¿¤½¦¡¤~¯à¥H¿é¤J±b¸¹¥½ 4 ½X¤§­ì«h·j´M±a¥X¬ÛÃö§t¦³ 1020¤§¿ï¶µ

§Æ±æµ²ªG¬O¥H¼Ò½k¬d¸ß¤è¦¡
¨Ò¦p¦b  Q8Àx¦s®æ¥H¼Æ¦r¤è¦¡(¥½4½X)©Î¥H¤á¦W¤è¦¡¬d¸ß



0117.rar (122.7 KB)

¥»©«³Ì«á¥Ñ Andy2483 ©ó 2023-2-20 15:00 ½s¿è

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


    ÁÂÁ«e½ú
¾Ç¤½¦¡«Ü¤£Â²³æ!À´VBA¸Ñªk¤£¤@©w·|¤½¦¡¸Ñªk,«á¾Ç¾q¶w,¾Ç¤½¦¡§Æ±æ¶Ô¯à¸É©å
¥H¤U¬O«á¾Ç¾Ç²ß¥HVBAªº¤è¦¡³B²z,Àµ½Ð«e½ú¦A«ü¾É,ÁÂÁÂ
¤£¥Î(Application.EnableEvents = False)ºÉ¤O¨¾°ô¦AIJµo,¤£ª¾¤°»ò­ì¦]ÁÙ¬Oµo¥Í¦AIJµo¤F,­þ¸Ì¿ù¤F??

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Arr, V$, N&, A$, i&
With Target
  If InStr(.Address, "$Q$9") Or .Count > 1 Then
      Exit Sub
   End If
   If .Address = "$Q$8" Then
      V = .Value
      Arr = Sheets("«È¤á°ò¥»¸ê®Æ").Range([«È¤á°ò¥»¸ê®Æ!D1], [«È¤á°ò¥»¸ê®Æ!C65536].End(3))
      For i = 2 To UBound(Arr)
         If Arr(i, 1) & Arr(i, 2) & "/" Like "*" & V Then
            A = Split(V, "*")(0)
            A = Format(InStr(Arr(i, 1) & Arr(i, 2) & "/", A), "00|")
            N = N + 1
            Arr(N, 1) = A & Arr(i, 1) & "_" & Arr(i, 2)
         End If
      Next
      Range([Q9], Cells(Rows.Count, "Q").End(3)(2)) = ""
      If N = 0 Then Exit Sub
      With .Item(2, 1).Resize(N, 1)
         .Value = Arr
         If N > 1 Then
            [T:W].EntireColumn.Hidden = False
            .Sort Key1:=.Item(1), Order1:=xlAscending, Header:=xlNo
            [T:W].EntireColumn.Hidden = True
         End If
         .Replace "*|", ""
      End With
   End If
End With
End Sub
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

¦^´_ 9# Andy2483

«D±`·PÁ  Andy2483  ¼ö¤ß¦^ÂР ^^

À´±oÀ³¥Î¤~¹³¾Ç¥Í,Áy¥Ö«pÂI¾Ç·|§óÂÔ·V¿n·¥

°w¹ïÃD¤º¤½¦¡¥Î¤ß¸Ô²ÓÁ¿¸Ñ¨C¤@¹Lµ{§t·N...¤ß¤¤·P®¦

TOP

¥»©«³Ì«á¥Ñ Andy2483 ©ó 2023-2-18 15:46 ½s¿è

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


    ÁÂÁ«e½ú,½Ð«e½ú¦A«ü¾É

1.¥ý¦b«È¤á°ò¥»¸ê®Æªí³]»²§UÄæ(BÄæ)
1.1.´Ó¤J=IF(³æ!$Q$8="","",IF(ISERR(SEARCH(³æ!$Q$8,C2&D2&"/")),"",ROW(A2)))    :Åã¥Ü ªÅ¥Õ©Î¦C¸¹

1.2.SEARCH(³æ!$Q$8,C2&D2&"/"): ¦^¶Ç ¦r¤¸¦ì¸m
¥H ³æ!$Q$8­È¦r¦ê·í­n§ä´Mªº¤å¦r, ¥ÎSEARCH()·j´M C2&D2&"/" ©Ò²Õ¦¨ªº·s¦r¦ê ¦^¶Ç ©Ò¦bªº¶}©l¦ì¸m
³æ!$Q$8 ="¤¤µØ*1020/" : ¬O­n§ä´Mªº¤å¦r,¦Ó¤¤¶¡¦³­Ó * ¸U¦r¤¸,©Ò¥H§ä´Mªº¤å¦r¦ê¬O: ¥H "¤¤µØ" ¶}ÀY, ¥H "1020/" µ²§Àªº³sÄò¦r¦êªº·N«ä
³Ì«áªº "/" ¬O¬°¤F½T©w¬O¦r¦êªºµ²§À¦r¤¸
¦pªG­n§ä´Mªº¤å¦r¤£¦b C2&D2&"/" ©Ò²Õ¦¨ªº¦r¦ê¸Ì! «h·|¶Ç¦^ #VALUE! ¿ù»~­È¡C

1.3.ISERR(¦r¤¸¦ì¸m): ¿ù»~­È§P©w ¦^¶Ç1©Î0
¦pªG ¦r¤¸¦ì¸m ¦^¶Ç  #VALUE! ¿ù»~­È!   ¿ù»~­È§P©w¬O1
¦ý¦pªG ¦r¤¸¦ì¸m¬O¼Æ¦r! ¿ù»~­È§P©w¬O0

1.4.IF(¿ù»~­È§P©w,"",ROW(A2))) :ªÅ¥Õ©Î¦C¸¹
IF(³æ!$Q$8="","",ªÅ¥Õ©Î¦C¸¹)
¦pªG ³æ!$Q$8 ¬OªÅ¥Õ!´N¤£¥²SEARCH(),¦bÀx¦s®æÅã¥ÜªÅ¥Õ
§_«h´N¦^¶Ç IF(ISERR(SEARCH()),"",ROW(A2))¬OªÅ¥Õ©Î¦C¸¹,Åã¥Ü¦bÀx¦s®æ

2.[Q9]=INDEX(«È¤á°ò¥»¸ê®Æ!C:C,SMALL(«È¤á°ò¥»¸ê®Æ!B:B,ROW(A1)))&"_"&INDEX(«È¤á°ò¥»¸ê®Æ!D:D,SMALL(«È¤á°ò¥»¸ê®Æ!B:B,ROW(A1)))
¤¤µØ¹q«HªÑ¥÷¦³­­¤½¥q_66001020001020

2.1.Åã¥Ü ¦^¶Ç¤á¦W&"_" & ¦^¶Ç±b¸¹

2.2.¦^¶Ç¤á¦W=INDEX(«È¤á°ò¥»¸ê®Æ!C:C,SMALL(«È¤á°ò¥»¸ê®Æ!B:B,ROW(A1)))        ="¤¤µØ¹q«HªÑ¥÷¦³­­¤½¥q"
ROW(A1)   =1
SMALL(«È¤á°ò¥»¸ê®Æ!B:B,ROW(A1))      =2
¦^¶Ç «È¤á°ò¥»¸ê®Æ!BÄæ²Ä1¤pªº­È

INDEX(«È¤á°ò¥»¸ê®Æ!C:C,SMALL(«È¤á°ò¥»¸ê®Æ!B:B,1))
INDEX(«È¤á°ò¥»¸ê®Æ!C:C,2)
¦^¶Ç «È¤á°ò¥»¸ê®Æ!C2Àx¦s®æªº­È

2.3.¦^¶Ç±b¸¹=INDEX(«È¤á°ò¥»¸ê®Æ!D:D,SMALL(«È¤á°ò¥»¸ê®Æ!B:B,ROW(A1)))
ROW(A1)          =1
SMALL(«È¤á°ò¥»¸ê®Æ!B:B,ROW(A1))          =2
¦^¶Ç «È¤á°ò¥»¸ê®Æ!BÄæ²Ä1¤pªº­È

INDEX(«È¤á°ò¥»¸ê®Æ!D:D,2)
¦^¶Ç «È¤á°ò¥»¸ê®Æ!D2Àx¦s®æªº­È       =  "66001020001020"
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

¦^´_ 5# Andy2483

·PÁ  Andy2483  ¼ö¤ß¦^ÂР ^^

±N©Ò vba¼Ò²Õµ{¦¡½X²£¥Í¤À©î¦r¦ê
¤S¬O¥t¤@ºØ¤À¨É...Àò¯q¨}¦h

TOP

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

¤Ó·PÁª©¥D ­ã´£³¡ªL  @¦^ÂÐ

¹ê´úµ²ªG«D±`§¹¬ü
²³æ¥Ñ¹ê´f  ^^

TOP

¦^´_ 4# cypd

¸Õ¸Õ//
Xl0000363-1.rar (57.34 KB)

TOP

¥»©«³Ì«á¥Ñ Andy2483 ©ó 2023-1-19 08:30 ½s¿è

¦^´_ 4# cypd


    'ÁÂÁ«e½úµoªí¦¹¥DÃD»P½d¨Ò,ÁÂÁ ­ã´£³¡ªL«e½ú«ü¾É
'¥H¤U¬O«á¾Ç«Øij¤£Åܧó ­ã´£³¡ªL«e½ú½d¨Ò­ì¥»¤½¦¡ªº§é°J¤è®×:¤À©î¦r¦ê,½Ð«e½ú¸Õ¸Õ¬Ý

'±N¤U¦Cµ{¦¡½X©ñ¤J "³æ" ¤u§@ªí¼Ò²Õ¸Ì

Private Sub Worksheet_Change(ByVal Target As Range)
With Target
   If .Address = "$Q$8" Then
   '¡ô¦pªG½s¿è¤º®eªºÀx¦s®æ¦ì§}¬O "$Q$8"
      If InStr(.Value, "*") Then
      '¡ô¦pªG½s¿èªºµ²ªG¤º®e¸Ì¥]§t"*"¦r¤¸
         [S8] = Split(.Value, "*")(1): [Q8] = Split(.Value, "*")(0)
         '¡ôif±ø¥ó¦¨¥ß´N¥O[S8]Àx¦s®æ¬O ¥H"*"¦r¤¸¤À³Î[Q8]Àx¦s®æ«á¥kÃ䪺¦r¦ê,
         '¥O[Q8]Àx¦s®æ¬O ¥H"*"¦r¤¸¤À³Î[Q8]Àx¦s®æ«á¥ªÃ䪺¦r¦ê
         '©Ò¥H¥H[Q8]Àx¦s®æ¿é¤J "¥ÃÂ×*28" ¬°¨Ò:[S8]="28",[Q8]="¥ÃÂ×",
         '¥t¥~¥H "¥ÃÂ×*" ¬°¨Ò:[S8] = "" , [Q8]="¥ÃÂ×"

      End If
   End If
End With
End Sub

¿é¤J "¥ÃÂ×*28" :

µ²ªG:


----------------------------------------------------
¿é¤J "¥ÃÂ×*" :

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

TOP

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

«D±`·PÁª©¥D ­ã´£³¡ªL  @¦^ÂÐ
°w¹ï©Ò­z°ÝÃD¸Ñµª¦³¤@ºÃ°Ý??
­Y¬O¥u¦b­ìÀx¦s®æ¡KQ8  ¤£¥t³]¸m¡KS8  ªºª¬ºA¤U
¬O§_¦b­ìÀx¦s®æ¡KQ8¯à¹F¦¨¿é¤J²µu¤å¦r©Î¼Æ¦r,¥H¦WºÙ©Î±b¸¹¬d¸ß ??

TOP

ÁÂÁ´£°Ýªº..
¤]ÁÂÁ¦^µªªº­ã´£³¡ªL¥ý¶i..
¾Ç¨ì¤F..
¶³®p

TOP

        ÀR«ä¦Û¦b : ¤p¨Æ¤£°µ¡B¤j¨ÆÃø¦¨¡C
ªð¦^¦Cªí ¤W¤@¥DÃD