PDA

View Full Version : cut, paste, return loop



lijon
03-03-2008, 09:12 AM
Hi folks,here's my sub below. I'm trying to go through a list and cut out the rows that dont have text 'issuers' in columnH (7th column from A), and then paste the entire row in the next page named "non-issuer". It keeps going to debug mode and highlighting the 'activerow.cut' part in yellow. any ideas why i'm failing??? thanks thanks thanks/

'REMOVE NON-ISSUERS

Range("A2").Select
For count = 1 To 500
If ActiveCell.Offset(count, 7).Value <> "issuers" Then activerow.Cut
Sheets("non-issuer").Select
Cells(65000, 1).End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste
Sheets("loader").Select
Selection.End(xlDown).Select
End If
Next count

Bob Phillips
03-03-2008, 10:04 AM
Dim NextRow As Long
Dim i As Long

With Worksheets("non-issuer")

NextRow = .Cells(.Rows.Count, "A").End(xlUp).Row + 1
End With

With ActiveSheet.Range("A2")
For i = 1 To 500
If .Offset(i, 7).Value <> "issuers" Then

.Offset(i, 0).EntireRow.Cut Worksheets("non-issuer").Cells(NextRow, "A")
NextRow = NextRow + 1
End If
Next i
End With