Consulting

Results 1 to 2 of 2

Thread: cut, paste, return loop

  1. #1
    VBAX Regular
    Joined
    Mar 2008
    Posts
    16
    Location

    cut, paste, return loop

    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

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    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
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •