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

[µo°Ý] ½Ð°Ý¦p¦ó¼W¥[±ø¥ó§PÂ_°}¦C¬O¤@ºû©Î¬O¤Gºû©O¡H

[µo°Ý] ½Ð°Ý¦p¦ó¼W¥[±ø¥ó§PÂ_°}¦C¬O¤@ºû©Î¬O¤Gºû©O¡H

¦U¦ì¤j¤j¦n¡G

   ¤U¦C»yªk¦p¦ó¼W³]±ø¥ó§PÂ_ ar
¬O¤@ºû°}¦C©Î¬O¤Gºû°}¦C©O¡H

Sub aa()
   
    Dim ar1, ar2, ar3
    Dim mData()
    Dim s%, s1%, n1%, n2%
    Dim mSht1 As Worksheet
    Dim mSht2 As Worksheet
    Dim ar
   
    Set mSht1 = Worksheets(1)
    Set mSht2 = Worksheets(2)
   
    With mSht1
       ar1 = .Range("a1:c5")  '¤Gºû°}¦C
         ar2 = .Range("e8:g8")
       ar2 = Application.Transpose(Application.Transpose(ar2))  '¤Gºû°}¦CÂন¤@ºû°}¦C
         ar3 = .Range("h10:j14")  '¤Gºû°}¦C
        
      
        ReDim Preserve mData(0)
        mData(0) = ar1
      ReDim Preserve mData(1)
        mData(1) = ar2
      ReDim Preserve mData(2)
        mData(2) = ar3
        
        s = UBound(mData)
        For s1 = 0 To UBound(mData)
          ar = mData(s1)          '¦p¦ó§PÂ_ar ¬O¤@ºû°}¦C©Î¬O¤Gºû°}¦C©O¡H
             n1 = UBound(ar, 1)
          n2 = UBound(ar, 2)
          'if ¤Gºû°}¦C®É then
            mSht2.Range("a65536").End(xlUp).Resize(n1, n2) = ar '·íar=mdata(1)®É¬°¤Gºû°}¦C¡A¨Ï¥Î¦¹»yªk¡C
            'if ¤@ºû°}¦C®É then
            mSht2.Range("a65536").End(xlUp).Resize(, n2) = ar '·íar=mdata(1)®É¬°¤@ºû°}¦C¡A¨Ï¥Î¦¹»yªk¡C
          End If
        Next
        
    End With
            
End Sub

ÁÂÁ¦U¦ì¤j¤j¡C

arrTest.rar (9.67 KB)

¦^´_ 1# dechiuan999

­Y­n¨Ï¥ÎAPI¨ç¼Æ¨ú±oºû¼Æ½Ð°Ñ¦Ò
¨Ï¥ÎAPI¨ú±o°}¦Cºû«×
¤£µM¥i§Q¥Î¿ù»~½X¨ÓÅçÃÒºû«×
  1. Sub nn()
  2. Dim ay(2, 2, 3)
  3. MsgBox checkarray(ay)
  4. ar = Array(1, 2, 3, 4, 5)
  5. ar = Application.Transpose(ar)
  6. MsgBox checkarray(ar)
  7. ar = Application.Transpose(ar)
  8. MsgBox checkarray(ar)
  9. End Sub
  10. Function checkarray(Myar As Variant)
  11. On Error Resume Next
  12. i = 1
  13. Do Until Err.Number = 9
  14. n = LBound(Myar, i)
  15. If Err.Number = 0 Then i = i + 1
  16. Loop
  17. checkarray = i - 1
  18. End Function
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

ÁÂÁª©¥D¤j¤j¡C

¤p§Ì¥Ø«e¨Ï¥Î¿ù»~½X¨ÓÅçÃÒºû«×¡A
¤w¥i逹¦¨¶·¨D¡C
¦P®É¤]¦b¬ã¨sASPªºÀ³¥Î¤è¦¡¡C

·P®¦ª©¥D¤j¤j¡C

TOP

        ÀR«ä¦Û¦b : ¥¬¬I¦p¼½ºØ¡A¥HÅw³ß¤ß´þ¼íºØ¤l¡A¤~·|µoªÞ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD