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
Bookmarks