代码vba从列中插入一行

时间:2017-10-02 13:12:51

标签: excel vba excel-vba

enter image description here我有一个包含退款数据的文件,我需要插入一行,但不是从A列插入,而是留下A,B .....列,我保持原样并插入F列中的行Cels(i,A)= Cels(i + 1,A),观看我的桌子的截图以了解谢谢你我尝试了这个代码,但它没有用。

Sub match()

Dim i As Integer
Dim j As Integer


With Worksheets("Feuil1") 'Nom de feuille à adapter
DerLig = .Range("A" & .Rows.Count).End(xlUp).Row
For i = 2 To DerLig
    For j = i + 1 To DerLig

    If .Cells(i, "A") = .Cells(j, "A") Then
    Cells(j, 11).Select
    Selection.EntireRow.Insert

    End If

    Next j
    Next i

End With
End Sub
[![table screen shot][1]][1]

0 个答案:

没有答案