Excel vba For Each&对于循环

时间:2016-10-27 12:59:37

标签: excel vba excel-vba

lastColumn_Of_PO_line_Big_Table = Sheets("PO_line_Big_Table").UsedRange.Columns.Count + 1
a = Dict_Metadata.Keys
For Each b In a
    For i = 1 To UBound(Arr_PO_line_Big_Table)
        If Arr_PO_line_Big_Table(i, 1) = b Then
            With Worksheets("PO_line_Big_Table")
                nextRow = Sheets("Final_Result").Cells(Sheets("Final_Result").Rows.Count, 1).End(xlUp).row + 1
                '.Cells(nextRow, "A") = strKey
                '.Cells(i + 1, lastColumn_Of_PO_line_Big_Table) = "YES"
                Union(.Cells(i + 1, "E"), .Cells(i + 1, "K"), .Cells(i + 1, "L"), .Cells(i + 1, "M")).Copy
                Sheets("Final_Result").Range("B" & nextRow).PasteSpecial
            End With
        End If
    Next
Next

有人可以告诉我为什么它不会将工作表"PO_line_Big_Table"中的值粘贴到工作表Final_Result,谢谢你提前!!

0 个答案:

没有答案