troubleshooting Question

VBA find and move down 1 row

Avatar of Euro5
Euro5Flag for United States of America asked on
VBAMicrosoft ExcelMicrosoft Office
5 Comments1 Solution13 ViewsLast Modified:
I have been using this code, but now I believe it is deleting the row instead of moving the text one cell down!

I need to find these numbers in the array (part) in the row D and move the text down one row.
If it finds 63110 in D3, move it to D4.

    Set Ws = ActiveSheet
    With Ws
        varArray = Array("63110", "63120", "63130", "63140", "63150", "63100", "63395", "66045")
        For lngEntry = 0 To UBound(varArray)
            Set rngFound = .Cells.Find(What:=varArray(lngEntry), LookIn:=xlFormulas, _
                LookAt:=xlPart, SearchOrder:=xlByRows, _
                MatchCase:=False, SearchFormat:=False)
            If Not rngFound Is Nothing Then
                strSave = rngFound
                lngRow = rngFound.Row
                .Cells(lngRow, "D").EntireRow.Delete
                .Cells(lngRow, "D") = strSave
            End If
    End With
End Sub

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros