If you don't have formulas in any of the cells in column c or the cells you are searching you could use this.
If you don't mind having the formulas replaced with their results, you could use this.
It will run very fast on large data sets.
If you have formulas and want to keep them in place, then don't use this.
Sub MoveToColumnC()
Dim ws As Worksheet, lr As Long, lc As Long, arrC, arrData, j As Long, jj As Long
Set ws = ActiveSheet
lr = ws.Cells.Find(What:="*", After:=ws.Range("A1"), LookAt:=xlPart, LookIn:=xlFormulas, SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, MatchCase:=False).Row
lc = ws.Cells.Find(What:="*", After:=ws.Range("A1"), LookAt:=xlPart, LookIn:=xlFormulas, SearchOrder:=xlByColumns, _
SearchDirection:=xlPrevious, MatchCase:=False).Column
With ws
arrC = .Range("C1:C" & lr)
arrData = .Range(.Cells(1, 4), .Cells(lr, lc))
End With
For j = 1 To UBound(arrData, 1)
For jj = 1 To UBound(arrData, 2)
If arrData(j, jj) = "abc" Then
arrC(j, 1) = arrData(j, jj)
arrData(j, jj) = Empty
GoTo 1
End If
Next jj
1 Next j
Range("C1").Resize(UBound(arrC, 1), 1) = arrC
Range("D1").Resize(UBound(arrData, 1), UBound(arrData, 2)) = arrData
End Sub
Bookmarks