Below is the code to loop through and move the row. My struggle with this is too be able to find the word "Premium" within a cell never at the same position within a cell. I want to also look for the word "Special" within a cell. I assume I need to do an OR within the IF statement. Do I need to create a variable and use that? It is the equal signs that are confusing me. Thanks for any help.
__________________________________________________________________
Code:
[Sub Move_Data()
Dim i As Long, LastRow As Long, mydata As String, cutrow As Long
LastRow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).row
Application.ScreenUpdating = True
For i = LastRow To 2 Step -1
mydata = Cells(i, “D”)
If mydata = Range("D3:D5000").Find("Premium", Range("D3"), xlValues, xlWhole, xlByColumns, xlNext).row Then
Cells(i, “D”).EntireRow.Cut
cutrow = Worksheets("DataSpecialPrem").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).row
ActiveSheet.Paste Destination:=Worksheets(“DataSpecialPrem”).Rows(cutrow)
End If
Next i
End Sub]
Mod edit : thread moved to appropriate forum !
Last edited by a moderator: