I\'m trying to cut a row that has the specified cell blank and then paste it into another sheet in the same workbook. My coding works fine to delete the row but everything
If you want to cut and paste, see below:
With Sheet1
.Range("A1").Cut Sheeet2.Range("A1")
End With
Above cut's value in Cell A1 in Sheet1 and paste it on Cell A1 of Sheet2.
Now if you want to incorporate it in your code, see below.
Dim i As Long: i = 1
With Activesheet
For n = nLastRow To nFirstRow Step -1
If .Cells(n, "G") = "" Then
.Cells(n, "G").EntireRow.Cut Sheet2.Cells(i, "A")
.Cells(n, "G").EntireRow.Delete '~~> if you want to delete
i = i + 1
End If
Next
End With
Above code cuts all rows with Cell in G blank and paste it in Sheet2 starting A1.
Note: Sheet2 and Sheet1 that I used above are sheet codenames.