Results 1 to 7 of 7

search for string stops after sheet 7

Threaded View

  1. #1
    Registered User
    Join Date
    09-23-2010
    Location
    London, England
    MS-Off Ver
    2007
    Posts
    97

    search for string stops after sheet 7

    hi, i have some code which searches through a document for a string.. but currently it stops after 7th page!

    why is this?


    thanks


    Sub getrows()
    Dim x, a As Integer
    Dim ws As Worksheet, ch As Chart
    
    
    a = 1
    For Each ws In ThisWorkbook.Worksheets
    
    x = 6
    
    
    For x = 6 To 200
    
    
    
    
    If Cells(x, 4).Value = "Premier League (English football league championship)" Then
    Rows(x & ":" & x).Select
    Selection.Copy
    Sheets("returned values").Select
    Rows(a & ":" & a).Select
    ActiveSheet.Paste
    a = a + 1
    
    ws.Select
    End If
    
    If Cells(x, 4).Value = "Premier League" Then
    Rows(x & ":" & x).Select
    Selection.Copy
    Sheets("returned values").Select
    Rows(a & ":" & a).Select
    ActiveSheet.Paste
    a = a + 1
    
    ws.Select
    End If
    
    Next x
    
    
    
    
    Next ws
    
    
    End Sub
    Last edited by Jollyfrog; 11-02-2010 at 12:24 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