I'm struggling to look through all sheets within a workbook. If within a Sheet in column A Value 08 or 09 is found then copy entire row (where the value was found) in Sheet1.
I'm also trying to copy all values below each other.
Thank you
Sub CopyRows()
Sheets("Sheet1").Select
' Find the last row of data
FinalRow = Cells(Rows.Count, 1).End(xlUp).Row
' Loop through each row
For i = 2 To FinalRow
' Decide if to copy based on column D
ThisValue = Cells(i, 1).Value
If ThisValue = "08" Or "09" Then
Worksheets("Sheet1 (401)").Range("A9").Copy Worksheets("Sheet1").Range("A1")
Next i
End Sub
Example.xlsx
Bookmarks