I have a worksheet consisting of approximately 50,000 rows and 30 columns (A - AD). Each column has a heading. I need a macro that will quickly delete all rows that don't contain specific text in Column C. Column C will have names of schools, elementary, middle, and high. There are approximately 225 different school options to go in each row in Column C. For each macro, I will designate 35-45 schools to keep, with all other rows being deleted. ols. Let's say that for this example, I would like to keep all rows that contain any one of the following schools in Column C (SchName): Happy Valley Elementary; Rolling Thunder Middle; Betsy Ross High; and John Glenn High.
[TABLE="width: 918"]
<tbody>[TR]
[TD="align: center"]Lev
[/TD]
[TD="align: center"]SchID
[/TD]
[TD="align: center"]SchName
[/TD]
[TD="align: center"]ID
[/TD]
[TD="align: center"]FName
[/TD]
[TD="align: center"]LName
[/TD]
[TD="align: center"]Grade
[/TD]
[TD="align: center"]Gender
[/TD]
[TD="align: center"]Ethnic
[/TD]
[TD="align: center"]Elig
[/TD]
[/TR]
[TR]
[TD="align: center"]1
[/TD]
[TD="align: center"]1
[/TD]
[TD="align: center"]Happy Valley Elementary
[/TD]
[TD="align: center"]1234567
[/TD]
[TD="align: center"]Humpty
[/TD]
[TD="align: center"]Dumpty
[/TD]
[TD="align: center"]3
[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]2
[/TD]
[TD="align: center"]2
[/TD]
[TD="align: center"]Rolling Meadow Middle
[/TD]
[TD="align: center"]2345671
[/TD]
[TD="align: center"]Tom
[/TD]
[TD="align: center"]Cat
[/TD]
[TD="align: center"]8
[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]3
[/TD]
[TD="align: center"]3
[/TD]
[TD="align: center"]Tuckman County High
[/TD]
[TD="align: center"]3456712
[/TD]
[TD="align: center"]Jerry
[/TD]
[TD="align: center"]Maguire
[/TD]
[TD="align: center"]10
[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]4
[/TD]
[TD="align: center"]2
[/TD]
[TD="align: center"]Rolling Thunder Middle
[/TD]
[TD="align: center"]4567123
[/TD]
[TD="align: center"]Buzz
[/TD]
[TD="align: center"]Light-Year
[/TD]
[TD="align: center"]8
[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]5
[/TD]
[TD="align: center"]4
[/TD]
[TD="align: center"]Tuckman County Middle
[/TD]
[TD="align: center"]5671234
[/TD]
[TD="align: center"]Peter
[/TD]
[TD="align: center"]Brady
[/TD]
[TD="align: center"]7
[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]6
[/TD]
[TD="align: center"]5
[/TD]
[TD="align: center"]John Glenn High
[/TD]
[TD="align: center"]6712345
[/TD]
[TD="align: center"]John
[/TD]
[TD="align: center"]Glenn
[/TD]
[TD="align: center"]12
[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 918"]
<tbody>[TR]
[TD="align: center"]Lev
[/TD]
[TD="align: center"]SchID
[/TD]
[TD="align: center"]SchName
[/TD]
[TD="align: center"]ID
[/TD]
[TD="align: center"]FName
[/TD]
[TD="align: center"]LName
[/TD]
[TD="align: center"]Grade
[/TD]
[TD="align: center"]Gender
[/TD]
[TD="align: center"]Ethnic
[/TD]
[TD="align: center"]Elig
[/TD]
[/TR]
[TR]
[TD="align: center"]1
[/TD]
[TD="align: center"]1
[/TD]
[TD="align: center"]Happy Valley Elementary
[/TD]
[TD="align: center"]1234567
[/TD]
[TD="align: center"]Humpty
[/TD]
[TD="align: center"]Dumpty
[/TD]
[TD="align: center"]3
[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]2
[/TD]
[TD="align: center"]2
[/TD]
[TD="align: center"]Rolling Meadow Middle
[/TD]
[TD="align: center"]2345671
[/TD]
[TD="align: center"]Tom
[/TD]
[TD="align: center"]Cat
[/TD]
[TD="align: center"]8
[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]3
[/TD]
[TD="align: center"]3
[/TD]
[TD="align: center"]Tuckman County High
[/TD]
[TD="align: center"]3456712
[/TD]
[TD="align: center"]Jerry
[/TD]
[TD="align: center"]Maguire
[/TD]
[TD="align: center"]10
[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]4
[/TD]
[TD="align: center"]2
[/TD]
[TD="align: center"]Rolling Thunder Middle
[/TD]
[TD="align: center"]4567123
[/TD]
[TD="align: center"]Buzz
[/TD]
[TD="align: center"]Light-Year
[/TD]
[TD="align: center"]8
[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]5
[/TD]
[TD="align: center"]4
[/TD]
[TD="align: center"]Tuckman County Middle
[/TD]
[TD="align: center"]5671234
[/TD]
[TD="align: center"]Peter
[/TD]
[TD="align: center"]Brady
[/TD]
[TD="align: center"]7
[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]6
[/TD]
[TD="align: center"]5
[/TD]
[TD="align: center"]John Glenn High
[/TD]
[TD="align: center"]6712345
[/TD]
[TD="align: center"]John
[/TD]
[TD="align: center"]Glenn
[/TD]
[TD="align: center"]12
[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
</tbody>[/TABLE]
Last edited: