I am trying to find a script that finds certain values in sheet1 and paste those values in sheet2 A1.
- the range is whole sheet1
- needs to search all cells for anything that starts with "1Z" and "W"
- paste each cell data that starts with "1Z" and "W" in sheet2 under row A.
Currently have this script:
Sub delete_oldads()
Dim cel As Range, cfind As Range
ActiveSheet.UsedRange.Select
For Each cel In Selection
If cel = "" Then GoTo nextcel
Set cfind = cel.Find(what:="1Z", lookat:=xlPart)
If Not cfind Is Nothing Then
cfind.Copy Cells(cfind.Row, "A")
cfind.Clear
End If
nextcel:
Next cel
End Sub
But this one copy/paste all the matching cells in the same sheet and also if a match is found in the same row, it will copy the last one only.