Link to home
Start Free TrialLog in
Avatar of Seamus2626
Seamus2626Flag for Ireland

asked on

Sub to delete rows after key word

I have a spreadsheet, which has a key word called "SYSTEMICS" (Highlighted Yellow)

I want to be able to delete all rows after that word is found.

I have attached an example, it is always in ColB

Thanks
Seamus
test.xls
Avatar of Rob Henson
Rob Henson
Flag of United Kingdom of Great Britain and Northern Ireland image

Does it have to be VBA?

A helper column with a count of occurences of the word in cells above will show which to delete.

Assuming column C is available enter in C2

=COUNTIF(B$2:B2,"SYSTEMICS")

Copy down for extent of data.

AutoFilter on this column for greater than zero and delete the rows showing in the filter.

Cheers
ASKER CERTIFIED SOLUTION
Avatar of Eric Zwiekhorst
Eric Zwiekhorst
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Seamus2626

ASKER

Hi robhenson, i needed vba code for this as i need it to run as a procedure

Thanks Zwiekhorst

Cheers,
Seamus