Forum Discussion
Celinaexcel
Jun 21, 2023Copper Contributor
Please help: Excel VBA move completed projects to next worksheet (big worksheet)
Hello all, I am new to VBA coding and I have a big spreadsheet. I would like to cut and move an entire row to the worksheet named "Historic Sales" once I give the Value "completed" in Column ...
peiyezhu
Jun 22, 2023Bronze Contributor
- CelinaexcelJun 22, 2023Copper Contributor
peiyezhu I looked into it, and also followed the Links in that thread, however it doesn't seem to be working. I am not sure I understand what Information I have to switch to make it work for my case.
- peiyezhuJun 23, 2023Bronze Contributorhowever it doesn't seem to be working.
VBA Coding ?
If with VBA,I don't know how to do more research.
Maybe filter by keywords instead of moving will be more easier to process.- CelinaexcelJun 23, 2023Copper ContributorI've been trying this Code, but when I then write Done into the Area by Z nothing is moving.
Dim xRg As Range
Dim xCell As Range
Dim I As Long
Dim J As Long
Dim K As Long
I = Worksheets("Overview").UsedRange.Rows.Count
J = Worksheets("Completed Projects").UsedRange.Rows.Count
If J = 1 Then
If Application.WorksheetFunction.CountA(Worksheets("Completed Projects").UsedRange) = 0 Then J = 0
End If
Set xRg = Worksheets("Overview").Range("Z4:Z" & I)
On Error Resume Next
Application.ScreenUpdating = False
For K = 1 To xRg.Count
If CStr(xRg(K).Value) = "Done" Then
xRg(K).EntireRow.Copy Destination:=Worksheets("Completed Projects").Range("A" & J + 1)
xRg(K).EntireRow.Delete
If CStr(xRg(K).Value) = "Done" Then
K = K - 1
End If
J = J + 1
End If
Next
Application.ScreenUpdating = True
End Sub