I have a database with some systems. I have made a marco that loop through the data and if they meet certain criteria are copied to differenct sheet. Something like this
lrow = Sheets("database").Range("database").Rows.Count + 1
For i = 3 To lrow
If Sheets("Database").cells(i, "J").Value >= Sheets("Results").Range("C2").Value And _
Sheets("Database").cells(i, "K").Value <= Sheets("Results").Range("D2").Value And _
Sheets("Database").cells(i, "L").Value <= Sheets("Results").Range("E2").Value And _
Sheets("Database").cells(i, "N").Value = Sheets("Results").Range("G2").Value Then
Worksheets("Database").Rows(i).EntireRow.Copy
Worksheets("Results").Range("I" & i + 12).End(xlUp).Offset(1, -8).PasteSpecial xlPasteValuesAndNumberFormats
My problem is that cell G2 might have the word "marine" and the cells N can have one of the words "all", "marine", "brackish". I want,for example, the word "marine" to be included in the word "all" so that the macro will select the system that have the word all if the criteria is marine.
I hope I explained it correctly.
Bookmarks