Sufiyan97
Well-known Member
- Joined
- Apr 12, 2019
- Messages
- 1,543
- Office Version
- 365
- 2013
- Platform
- Windows
I want to make this code smaller and faster
Thanks you for your help in this in advance.
Thanks you for your help in this in advance.
VBA Code:
Sub MoveData()
Dim r1, r2
' Determine that last row in the PO Sheet (r1)
Sheets("PO").Select
r1 = Range("A65536").End(xlUp).Row
Dim count As Long
For count = 2 To r1
If Range("H" & count).Value = 0 Then
Rows(count).EntireRow.Cut
' Determine that last row in the Completed Sheet (r2)
Sheets("Completed").Select
r2 = Range("A65536").End(xlUp).Row
Rows(r2 + 1).EntireRow.Insert
Sheets("PO").Select
If Range("A" & count).Value = "" Then
Rows(count).EntireRow.Delete
End If
End If
Next count
End Sub