0
votes

I'm trying to create a Macro that will find text in a column (D) and if a criteria is met, then copies the row into to another sheet. The Criteria I am looking for will be not be the only text located in the cell. For Example the criteria could be "Prodigy" but the Cell could contain "Prodigy, Prodigy Tubing Set".

I have a Sheet called "Sheet1" which has all the raw data with headers. The column that has the values to meet the criteria is "D".

I have other sheets where the data will be copied to. For example one of the Sheets will be titled "Prodigy", another will be "Prodigy Tubing Set". There will up to 20 other sheets.

Macro: Given row X copy specific cells from that row to a new sheet

I tried using the code the person in the link above built but it would only work if my criteria was the only thing in the cell.

A picture of what my spreadsheet will look like is below. I am pretty new at this and would appreciate any possible assistance. Hope this makes sense.

1
I tried using the code the person in the link above please show your code if you like assistance. Edit: you want instr.findwindow

1 Answers

0
votes

I think the function you are looking for is InStr.

The example you posted has this: If cell.Value = "Card" Then

Instead, you will want something like this: If InStr(cell.Value, "Prodigy") > 0 Then

Of course, you will probably replace the literal "Prodigy" with some cell value or variable.