Solved: find, copy and paste
Hi guys :hi:
I'm trying to build a find, copy and paste macro, sounds simple enough.
It should find the word "report" in column H from sheet 1 and then move it to a different sheet and paste that row into the next available empty row on sheet 3. :thumb
However, :dunno , all it seems to do at the moment is find the second instance of the word "report" and copy it into infinity....:banghead:
Don't suppose I could draw on your superness once more to give me a hand spotting the issue?
[VBA]Dim lRealLastRow As Long
Sheets("Sheet1").Select
Cells.Find(What:="REPORT", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
Range(Selection, Cells(ActiveCell.Row, 1)).Copy
Sheets("Sheet3").Select
Range("A:A").Select
Do While ActiveCell > 0
lineno = lineno + 1
ActiveCell.Offset(1, 0).Select
ActiveCell.PasteSpecial xlPasteValues
Loop[/VBA]
Been playing with it for ages, managed to stop it picking the first instance only due to a silly error, but I really can't figure out what I've done to mess it up this time!! :wot
Thanks
Phel x