What I want to do?
I want to compare two sheets and if the row in sheet1 empty, then copy the same row from sheet(project).
How can I do that?
My goal is to copy the new entries at Colomn A from sheet("Project")
to sheet1
BUT only the new entries!
For example in sheet one A1:A20
already not blank. In sheet("project")
, A1:A27
are NOT Blank.
I want to copy the last 7 cells.
I wrote such a code, yet did not work.
Any idea? The code I write copies all the rows. I want to copy the rows which if they are blank in sheet1, then copy those rows from 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
A1:A27
and paste overA1:A20
:) It is max 2 lines of code (depending on how you want to copy) – Siddharth Rout