Cutting Row with Data and moving to different sheet VBA
- by user3709645
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 I've tried to cut and paste keeps giving me errors. Here's the working code that deletes the rows:
Sub Remove()
'Remove No Denovo &/or No Peak Seq
Dim n As Long
Dim nLastRow As Long
Dim nFirstRow As Long
Dim lastRow As Integer
ActiveSheet.UsedRange
Set r = ActiveSheet.UsedRange
nLastRow = r.rows.Count + r.Row - 1
nFirstRow = r.Row
For n = nLastRow To nFirstRow Step -1
If Cells(n, "G") = "" Then Cells(n, "G").EntireRow.Delete
Next n
End Sub
Thanks for any help!