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

[µo°Ý] ¨Ì¸ê®Æ¼ÐÃD ¤À³Î¦h­Ó¤u§@­¶

[µo°Ý] ¨Ì¸ê®Æ¼ÐÃD ¤À³Î¦h­Ó¤u§@­¶

¥»©«³Ì«á¥Ñ ¬PªÅÉ@¦ÐÁl ©ó 2023-7-5 15:27 ½s¿è

ªþ¥óªº°Ê§@°õ¦æ¦p¤U»¡©ú
¨Ìªþ¥ó¸Ì¤u§@ªí1 ªº¸ê®Æ¤À³Î¥X
¤@¤ë¡B¤G¤ë¡B¤T¤ë¡B¥|¤ëªº¤u§@­¶ («Ø¥ß·s¤u§@­¶¨Ã¨Ì¼ÐÃD©R¦W¤u§@­¶)
¨Ã±N¬ÛÃöªº¸ê®Æ½Æ»s¨ì¸Ó¤ëªº¤u§@­¶¸Ì¡C

¤u§@ªí1 ªº¸ê®Æ¸Ì¦³­«½Æ¤ë¥÷ (¤G¤ë)
­Y¹J­«½Æ¤ë¥÷ªº®É­Ô
±N­«½Æªº¤ë¥÷ªº¬¡°Ê¶K¨ì¸Ó¤ë¥÷¤u§@­¶¤º (¦¨®Ä¦pªþ¥óªº¤G¤ë)

½Ð°Ý¦U¦ì«e½ú¤W­z°Ê§@¦p¦ó¼¶¼g¦¨³q¥ÎªºVBAµ{¦¡©O?

0705_1.zip (10.07 KB)

¥»©«³Ì«á¥Ñ Andy2483 ©ó 2023-7-6 09:50 ½s¿è

¦^´_ 1# ¬PªÅÉ@¦ÐÁl


    ÁÂÁ½׾Â,ÁÂÁ«e½úµoªí¦¹¥DÃD»P½d¨Ò
«á¾ÇÂǦ¹©«½m²ß°}¦C»P¦r¨å,¾Ç²ß¤è®×¦p¤U

¸ê®Æªí:


µ²ªGªí:
20230706_2.jpg


Option Explicit
Sub TEST()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Dim Brr, Z, Q, i&, R&, T$
Set Z = CreateObject("Scripting.Dictionary")
For Each Q In Worksheets
   If Q.Name <> "¤u§@ªí1" Then Q.Delete
Next
Brr = Range([¤u§@ªí1!A1], [¤u§@ªí1!A65536].End(xlUp)(2))
For i = 1 To UBound(Brr) - 1
   If Brr(i + 1, 1) <> "¬¡°Ê" Then GoTo i01
   T = Application.Text(Brr(i, 1), "[DBNum1]m¤ë")
http://forum.twbts.com/viewthrea ... mp;page=3#pid120120
'¾Ç¨ì¤F ´N®³¨Ó¹B¥Î,ÁÂÁ ­ã´£³¡ªL«e½ú
   R = Z(T & "/r")
   If Z(T) = "" Then
      With Worksheets.Add(after:=Worksheets(Sheets.Count))
         .Name = T
         .Cells(1, 1) = T
         .Cells(2, 1) = Brr(i + 1, 1)
         .Cells(3, 1) = Brr(i + 2, 1)
      End With
      Z(T) = 1: Z(T & "/r") = 3: i = i + 2: GoTo i01
   End If
   R = R + 1
   Sheets(T).Cells(R, 1) = Brr(i + 2, 1)
   Z(T & "/r") = R
i01: Next
Application.Goto [¤u§@ªí1!A1]
Set Z = Nothing: Erase Brr
End Sub

¾Ç²ß­«ÂI:
1.¥H¦r¨å°O¿ý¤u§@ªí¦W¬O§_¦s¦b
2.¥H¦r¨å°O¿ý¨C­Ó¤u§@ªí¨Ï¥Îªº³Ì«á¦C¼Æ
3.ÃöÁä¦r¬O "¬¡°Ê"
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

ÁÂÁ½׾Â,ÁÂÁ¦U¦ì«e½ú
«á¾ÇÂǦ¹©«½m²ß°}¦C»P¦r¨å,¾Ç²ß¤è®×¦p¤U


Option Explicit
Sub TEST_1()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Dim Brr, Crr(1 To 1000, 1 To 1), A, Z, Q, i&, R&, T$
Set Z = CreateObject("Scripting.Dictionary")
For Each Q In Worksheets
   If Q.Name <> "¤u§@ªí1" Then Q.Delete
Next
Brr = Range([¤u§@ªí1!A1], [¤u§@ªí1!A65536].End(xlUp)(2))
For i = 1 To UBound(Brr) - 1
   If Brr(i + 1, 1) <> "¬¡°Ê" Then GoTo i01
   T = Application.Text(Brr(i, 1), "[DBNum1]m¤ë")
   A = Z(T): R = Z(T & "/r")
   If Not IsArray(A) Then
      A = Crr
      A(1, 1) = T
      A(2, 1) = Brr(i + 1, 1)
      A(3, 1) = Brr(i + 2, 1)
      Z(T) = 1: Z(T & "/r") = 3: i = i + 2: Z(T) = A: GoTo i01
   End If
   R = R + 1
   A(R, 1) = Brr(i + 2, 1)
   Z(T & "/r") = R: Z(T) = A
i01: Next
For Each Q In Z.KEYS
   If Not IsArray(Z(Q)) Then GoTo z01
   With Worksheets.Add(after:=Worksheets(Sheets.Count))
      .Name = Q
      .[A1].Resize(Z(Q & "/r"), 1) = Z(Q)
   End With
z01: Next
Application.Goto [¤u§@ªí1!A1]
Set Z = Nothing: Erase Brr, A, Crr
End Sub

¾Ç²ß­«ÂI:
1.¦r¨å ITEM¬O¤Gºû°}¦C
2.¤@¦¸©Ê¼g¤J¤u§@ªí¤¤
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

¦^´_ 3# Andy2483
·PÁ«e½úªº±Ð¾Ç
«á¾Ç¥ý¨Ó¾Ç²ß¾Ç²ß
­Y¦³°ÝÃD¦A¸ò«e½ú½Ð±Ð½Ð±Ð
ÁÂÁ¡I

TOP

        ÀR«ä¦Û¦b : ¬Ý§O¤H¤£¶¶²´¡A¬O¦Û¤v­×¾i¤£°÷¡C
ªð¦^¦Cªí ¤W¤@¥DÃD