如果单元格只是空白,我如何从另一个 sheet 复制单元格?

How can I copy from another sheet for the cells if they are only blank?

我想比较两张纸,如果 sheet1 中的行为空,则复制 sheet(project) 中的同一行。

我的目标是将 A 列的新条目从 sheet("Project") 复制到 sheet1,但只复制新条目!

例如在sheet1 A1:A20中已经不为空。在 sheet("project") 中,A1:A27 不为空。

我想复制最后 7 个单元格。

我写的代码复制了所有的行。我想复制 sheet1 中空白的行,然后从 sheet(project).

中复制这些行
Sub CopyD()

    Dim lst As Long

    Sheets("Project").Select

    Range("A1:A10000").Select

    Application.CutCopyMode = False

    Selection.Copy

    With Sheets("Sheet1")
        lst = .Range("A" & Rows.Count).End(xlUp).Row + 1
        .Range("A" & lst).PasteSpecial xlPasteColumnWidths
        .Range("A" & lst).PasteSpecial xlPasteValues
    End With

End Sub
Sub CopyNewRows

Dim x as long
dim y as long
with worksheets("Sheet1")
x = .cells(.rows.count,1).end(xlup).row  'last occupied row in col A
end with
with  worksheets("Project")
y =.cells(.rows.count,1).end(xlup).row 'last occupied row in source sheet
.range(.cells(x+1,1),.cells(y,1)).entirerow.copy worksheets("sheet1").cells(x+1,1)
end with
end sub

这假设 A 列始终为每个占用的行填充