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

[µo°Ý] ¨Ïarray() ¹³ additem¤@¼Ë¼W¥[item

[µo°Ý] ¨Ïarray() ¹³ additem¤@¼Ë¼W¥[item

´N±Ð©ó¦U¦ì¤j¤j
d(A & "") =Array(A.Offset(, 3).Value, A.Offset(, 4).Value, A.Offset(, 6).Value)
¦p¦ó¨Ïarray() ¹³ additem¤@¼Ë§Q¥ÎVBA»yªk¨Ó¼W¥[item?
ÁÂÁÂ

Sub test()
    Dim a As Range
    Set a = Range("A1")
    Dim d()
    d = Array(a.Offset(, 3).Value, a.Offset(, 4).Value, a.Offset(, 6).Value) '3­Ó­È
    ReDim Preserve d(4) '¦h¥[¨â­ÓªÅ¶¡,«O¯d ²Ä1,2,3­Ó­È
    d(3) = "4"
    d(4) = "5"
End Sub
À´±oµo°Ý,µª®×´N·|¦b¨ä¤¤

¤µ¤éの¤@¬íは  ©ú¤éにない
http://kimbalko-chi.blogspot.com
http://kimbalko.blogspot.com

TOP

¥»©«³Ì«á¥Ñ yangjie ©ó 2012-9-7 00:47 ½s¿è

¦^´_ 2# kimbal
·P¿EKimbal
°ÝÃD¬°
default1 = wbf.Sheets("¼È¦s").Cells(1, 5)
For i = 1 To 10
        n1(i) = wbf.Sheets("¼È¦s").Cells(i, 6)
        If n1(i) = 0 Then
            s1 = i - 1  's1¶×¥X­Ó¼Æ
            Exit For
        End If
Next
Dim d As Object
    Dim a As Range
    Set d = CreateObject("Scripting.Dictionary")
     With Workbooks(str1).Sheets(sh1)
        For Each a In .Range(.[2,default1], .[65536,default1].End(xlUp))
            d(a & "") = Array(a.Offset(, n1(1)-default1).Value, a.Offset(,  n1(2)-default1).Value] ,---¦@s1­Ó)
        Next
    End With
    À³¦p¦ó­×§ï¬õ¦â¨º¤@¦æ¤§»yªk?

TOP

¦^´_ 2# kimbal
·P¿EKimbal  2# ªº±Ð¾É
§Ú¥t¥~¥Î±zªº¤èªk¥[¤@­Ó array   d1( )  ¥H d1(1),d1(2),d1(3)¤è¦¡¼W¥[array¤ºitems
µM«á d(a & "") = d1
¸Ñ¨M¤F§Úªº°ÝÃD
¦p¤U  
    Dim d As Object
    Dim a As Range
    Set d = CreateObject("Scripting.Dictionary")
    With Workbooks(str1).Sheets(sh1)
        For Each a In .Range(.Cells(2, default1), .Cells(65536, default1).End(xlUp))
            Dim d1()
            d1 = Array(a.Offset(, n1(1) - default1).Value)
            If s1 > 1 Then
                For i = 2 To s1
                    ReDim Preserve d1(i - 1)
                    d1(i - 1) = a.Offset(, n1(i) - default1).Value
                Next
            End If
            d(a & "") = d1
        Next
    End With
¨Ñ¤j®a°Ñ¦Ò«ü±Ð   
ºî¦X¦h¤Ñ¨Ó ¦b¦U©««ü¾É
ÁÂÁ Kimbal  & Hsieh & GBKEE  ¤T¦ì¤j¤j

TOP

        ÀR«ä¦Û¦b : ¤@­Ó¤H¤£©È¿ù¡A´N©È¤£§ï¹L¡A§ï¹L¨Ã¤£Ãø¡C
ªð¦^¦Cªí ¤W¤@¥DÃD