For a while now, I've been working on this code, but I can't seem to get it to accomplish what I want. I've been circling it in my mind. In essence, I want it to locate and relocate a row based on the value in cStatus. When the value is "Done," it is transferred to Sheet 4. The value is transferred to Sheet2 if the value is "On-going." If the value is "," it remains. Right now, the code I have won't run, but it also won't provide any error messages. I'm not sure how to proceed because I'm not sure what the problem is. I probably made a typo, but I don't see where. Any guidance would be highly valued.
Sub MoveBasedOnValue2()
Dim cStatus As Range, wsDest As Worksheet, Keywords As Range
Dim Table1 As Range, Table2 As Range
Set cStatus = Sheet1.Range("N2")
If Not cStatus Is Nothing Then
'Do While Len(cStatus.Value) > 0
Select Case LCase(cStatus.Value)
Case "Done": Set wsDest = Sheet4
Case "On-going": Set wsDest = Sheet2
Case Else: Set wsDest = Nothing
End Select
If Not wsDest Is Nothing Then
cStatus.EntireRow.Range("A2:N2").Cut _
Destination:=wsDest.Cells(Rows.Count, "A").End(xlUp).Offset(1)
End If
End If
If cStatus Is Nothing Then
Set cStatus = Sheet1.Range("N1:N1000").Find(what:="Done, On-going")
Do While Len(cStatus.Value) > 0
Select Case LCase(cStatus.Value)
Case "done": Set wsDest = Sheet4
Case "on-going": Set wsDest = Sheet2
Case Else: Set wsDest = Nothing
End Select
If Not wsDest Is Nothing Then
cStatus.EntireRow.Cut _
Destination:=wsDest.Cells(Rows.Count, "A").End(xlUp).Offset(1)
End If
Loop
End If
End Sub