Godders199
Active Member
- Joined
- Mar 2, 2017
- Messages
- 313
- Office Version
- 2013
Hello, i have written the following which i hoped would extract the relevant rows for me, however it currently returns no results.
Sub Test()
For Each Cell In Sheets("submission report").Range("bd:bm")
If Cell.Value = Sheets("instructions").Range("a8") Then
matchRow = Cell.Row
Rows(matchRow & ":" & matchRow).Select
Selection.Copy
Sheets("Results").Select
ActiveSheet.Rows(matchRow).Select
ActiveSheet.Paste
Sheets("Instructions").Select
End If
Next
End Sub
Effectively i want it to look at columns BD:BM, if the word contained in "Sheets("instructions").Range("a8")" then copy and paste the row to the results tab.
Think the issue might be that the cells contain more than one word , so it is currently only looking for an extact match. I have tried putting ** around A8 but this still does not make any difference.
Grateful if someone can tell me what i am doing wrong.
Sub Test()
For Each Cell In Sheets("submission report").Range("bd:bm")
If Cell.Value = Sheets("instructions").Range("a8") Then
matchRow = Cell.Row
Rows(matchRow & ":" & matchRow).Select
Selection.Copy
Sheets("Results").Select
ActiveSheet.Rows(matchRow).Select
ActiveSheet.Paste
Sheets("Instructions").Select
End If
Next
End Sub
Effectively i want it to look at columns BD:BM, if the word contained in "Sheets("instructions").Range("a8")" then copy and paste the row to the results tab.
Think the issue might be that the cells contain more than one word , so it is currently only looking for an extact match. I have tried putting ** around A8 but this still does not make any difference.
Grateful if someone can tell me what i am doing wrong.