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

Excel VBA ½Ð¯q II

¦^´_ 10# zz0660


§Ú¥Î§A8¼Óªºªþ¥ó¨º­ÓÀÉ®×´ú¸Õ¡A¤@¯ë¼Ò²Õ©M¤u§@ªí³£¨S°ÝÃD¡A½Ð¦A½T»{¡AÁÂÁÂ

TOP

¥»©«³Ì«á¥Ñ Andy2483 ©ó 2023-5-31 15:07 ½s¿è

ÁÂÁ½׾Â,ÁÂÁ¦U¦ì«e½ú
«á¾ÇÂǦ¹©«½m²ß°}¦C»P¦r¨å,¾Ç²ß8#¼Ó½d¨Ò¤è®×¦p¤U,½Ð¦U¦ì«e½ú«ü±Ð

AAªí°õ¦æ«e:


¸ü¦ÜAAªí_°õ¦æµ²ªG:


AAªí_¨Ï¥ÎªÌ°õ¦æÀx¦s®æ½s¿è:


¼g¤JQQªí_°õ¦æµ²ªG:



Option Explicit
Public K%
Sub TEST()
Dim Qrr, Arr, Y, Z, i&, j&, T1$, T2$, TT$
Dim Q As Range, A As Range, Shq As Worksheet, Sha As Worksheet
Set Y = CreateObject("Scripting.Dictionary")
Set Sha = Sheets("AA"): Set Shq = Sheets("QQ")
Set Q = Range(Shq.[A1], Shq.UsedRange): Qrr = Q
For i = 1 To UBound(Qrr, 1) Step 19
   For j = 2 To UBound(Qrr, 2) Step 9
      T1 = Qrr(i, j): T2 = Qrr(i, j + 1): TT = T1 & "|" & T2
      If T1 = "" Or T2 = "" Then GoTo j01
      Set Y(TT) = Range(Q(i, j - 1), Q(i + 18, j + 7))
      Y(TT & "|v") = Y(TT)
j01: Next
Next
Set A = Sha.[B1:J19]: Arr = A
T1 = Arr(1, 2): T2 = Arr(1, 3): TT = T1 & "|" & T2
If K = 1 Then A = Y(TT & "|v")
If K = 2 Then Set Q = Y(TT): Q = Arr
Set Y = Nothing: Set Q = Nothing: Set A = Nothing
Set Sha = Nothing: Set Shq = Nothing: Erase Qrr, Arr
End Sub
'================================
Sub ¸ü¦ÜAAªí()
K = 1: Call TEST
End Sub
'================================
Sub ¼g¤JQQªí()
K = 2: Call TEST
End Sub
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

        ÀR«ä¦Û¦b : ¨C¤ÑµL©Ò¨Æ¨Æ¡A¬O¤H¥Íªº®ø¶OªÌ¡A¿n·¥¡B¦³¥Î¤~¬O¤H¥Íªº³Ð³yªÌ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD