| ©«¤l162 ¥DÃD44 ºëµØ0 ¿n¤À244 ÂI¦W0  §@·~¨t²Îwindows 7 ³nÅ骩¥»office 2010 ¾\ŪÅv20 ©Ê§O¨k µù¥U®É¶¡2011-4-4 ³Ì«áµn¿ý2022-10-3 
 
 | 
                
| ¥»©«³Ì«á¥Ñ jesscc ©ó 2011-10-22 22:45 ½s¿è 
 ¤w×¥¿¿ù§R¼ÐÃD¦Cªº°ÝÃD¡A¨Ã¥B¤]¥i¥H¬d¸ß¤F¡A¥u¬O¬d¸ßµ²ªG¤£²Å©Ò»Ý¡A¥u¯à¶Ç¦^³Ì«á¤@µ§
 ½Æ»s¥N½XSub query1()
Dim i%, Ar(), A As Range
If [E13] <> "" Then
     Columns("G:I").EntireColumn.Hidden = True
     Range([E13], Cells(Rows.Count, 5).End(xlUp)).SpecialCells(xlCellTypeConstants).EntireRow.Delete
AA:
Set d = CreateObject("Scripting.Dictionary")
Set d1 = CreateObject("Scripting.Dictionary")
    With Sheets("OpenOrder")
        For Each A In Range(.[E7], .[E65536].End(xlUp))
            d(A.Value) = A.Offset(, 2).Value
            d1(A.Value) = Array(A.Value, A.Offset(, 1).Value, "", "", "", A.Offset(, 5).Value, "", "", A.Offset(, 8).Value, A.Offset(, 9).Value, A.Offset(, 10).Value, A.Offset(, 11).Value, A.Offset(, 12).Value)
        Next
    End With
    With Sheets("B")
        For Each A In Range(.[D12], .[D65536].End(xlUp)).SpecialCells(xlCellTypeConstants)
           For Each ky In d.keys
              If ky = A Then
              ReDim Preserve Ar(s)
              Ar(s) = d1(ky)
              s = s + 1
              End If
           Next
           
           If s > 0 Then
           A.Offset(1, 0).Resize(s, 1).EntireRow.Insert
           A.Offset(1, 1).Resize(s, 13) = Application.Transpose(Application.Transpose(Ar))
           s = 0: Erase Ar
           End If
        Next
    End With
Set d = Nothing
Set d1 = Nothing
Else
GoTo AA
End If
End Sub
 | 
 |