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

[µo°Ý] VBA ±ø¥ó¦¬´M

[µo°Ý] VBA ±ø¥ó¦¬´M


¦U¦ì«e½ú¦n
®Ú¾ÚÀx¦s®æA3¡AB2 C2 D2 E2 ªºÀx¦s®æ±ø¥ó¤U¡A¦¬´MA3¦r¦ê±N¸ê®Æ±a¤JB3 C3 D3 E3ªº³B¦s®æ¸Ì¡C
·PÁ«e½ú±Ð¾É¡A¥Ø«e¦bªì¾ÇµÛ¦Û¾Ç¤¤
will

¥»©«³Ì«á¥Ñ Andy2483 ©ó 2023-3-20 09:58 ½s¿è

¦^´_ 1# willeddie


    ÁÂÁ«e½úµoªí¦¹¥DÃD»P±¡¹Ò
«á¾Ç½m²ß¶Ã¼Æ.°}¦Cªº¸Ñ¨M¤è®×¦p¤U,½Ð«e½ú°Ñ¦Ò

VBA ±ø¥ó¦¬´M_20230320_1.zip (17.76 KB)

°õ¦æ«e:


°õ¦æµ²ªG:


Option Explicit
Sub TEST()
Dim Brr, i&, j%
'¡ô«Å§iÅܼÆ:Brr¬O³q¥Î«¬ÅܼÆ,i¬Oªø¾ã¼Æ,j¬Oµu¾ã¼Æ
Brr = Range([E1], Cells(Rows.Count, "A").End(3))
'¡ô¥OBrr³o³q¥Î«¬ÅܼƬO¤Gºû°}¦C,¥H[E1]¨ìAÄæ³Ì«á¦³¤º®eÀx¦s®æ­È±a¤J
For i = 2 To UBound(Brr)
'¡ô³]¶¶°j°é!i±q2¨ì Brr°}¦CÁa¦V³Ì¤j¯Á¤Þ¸¹
   For j = 2 To UBound(Brr, 2)
   '¡ô³]¶¶°j°é!j±q2¨ì Brr°}¦C¾î¦V³Ì¤j¯ÁÄ渹
      Brr(i, j) = Trim(Split(Split(Brr(i, 1), Brr(1, j))(1) & "(", "(")(0))
      '¡ô¥Oi°j°é¦Cj°j°éÄæBrr°}¦C­È¬O
      'i°j°é¦C²Ä1Äæ°}¦C­È ¥Î²Ä1¦C²Äj°j°éÄæ°}¦C­È°µ¤À³Î¦¨¤@ºû°}¦C,
      '¨ú¯Á¤Þ¸¹1ªº°}¦C­È,¥H¦¹°}¦C­È³s±µ"("²Å¸¹,¦¨¬°·s¦r¦ê
      '¦A±N¦¹·s¦r¦ê¥Î"("²Å¸¹¤À³Î¦¨¤@ºû°}¦C,¨ú¯Á¤Þ¸¹0ªº°}¦C­È

   Next
Next
[A1].Resize(UBound(Brr), UBound(Brr, 2)) = Brr
'¡ô¥O[A1]ÂX®i¦V¤UBrrÁa¦V³Ì¤j¯Á¤Þ¦C¸¹¼Æ,ÂX®i¾î¦V³Ì¤j¯Á¤ÞÄ渹¼Æ,
'³o½d³òÀx¦s®æ­È¥HBrr°}¦C­È±a¤J

Erase Brr
'¡ôÄÀ©ñÅܼÆ
End Sub
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

google"EXCEL°g"  blog  ©Îgoogleºô§}:https://hcm19522.blogspot.com/

TOP

¦^´_ 1# willeddie


½Ð¤W¶ÇÀÉ®×//
³o¤½¦¡¤]¥i¥Hªº

TOP

        ÀR«ä¦Û¦b : ¦³¤ß´N¦³ºÖ¡A¦³Ä@´N¦³¤O¡A¦Û³yºÖ¥Ð¡A¦Û±oºÖ½t¡C
ªð¦^¦Cªí ¤W¤@¥DÃD