Copy And Paste

watkins6878

Board Regular
Joined
Nov 26, 2005
Messages
96
Hi all

I have a problem I need to loop through each row in sheet 1 looking @ column K to see the the word PAID is there and if it is cut it from sheet1 and paste it to the next blank row in sheet 2 can someone point me in the right direction please

thanks in advance

Alan
 

Some videos you may like

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

acw

MrExcel MVP
Joined
Feb 13, 2004
Messages
4,814
Alan

How about

Code:
Sub ccc()
  Set findit = Range("K:K").Find(what:="PAID")
  If Not findit Is Nothing Then
    Do
      findit.EntireRow.Cut Destination:=Sheets("sheet2").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
      Set findit = Range("K:K").FindNext(findit)
    
    Loop Until findit Is Nothing
  End If
End Sub


Tony
 

watkins6878

Board Regular
Joined
Nov 26, 2005
Messages
96
Hi acw

When I tried your code i got (Subscript out of range) on this line

Code:
findit.EntireRow.Cut Destination:=Sheets("sheet2").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)

alan
 

watkins6878

Board Regular
Joined
Nov 26, 2005
Messages
96
Hi acw

Sorry my fault I Used sheet1 and sheet2 in place of the real sheet names I replaced sheet 2 and it work great.

Thank you

Alan
 

Watch MrExcel Video

Forum statistics

Threads
1,113,955
Messages
5,545,167
Members
410,667
Latest member
Gaexel
Top