Results 1 to 10 of 10

Loop Search Text and cut/paste

Threaded View

  1. #1
    Forum Contributor
    Join Date
    06-16-2010
    Location
    Tampa, FL
    MS-Off Ver
    Excel 2010
    Posts
    278

    Loop Search Text and cut/paste

    This works but I don't know how to stop the loop (quit when it can't find "AR:") Thank you for any assistance


        Dim intRowCount As Integer
        intRowCount = Range("A1").CurrentRegion.Rows.Count - 1
      
     Do
         Cells.Find(What:="AR:", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
            xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
            , SearchFormat:=False).Activate
        ActiveCell.Offset(0, 1).Range("A1:H1").Select
        Selection.Cut
        ActiveCell.Offset(-1, 1).Range("A1").Select
        ActiveSheet.Paste
        ActiveCell.Offset(0, -2).Range("A1").Select
        Cells.Find(What:="AR:", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
            xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
            , SearchFormat:=False).Activate
        Selection.EntireRow.Delete
    End
    
    End Sub
    Last edited by ker9; 06-16-2010 at 03:41 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1