VBA (Macro) - Search Column in List for Specific words and delete rows that don't match.

turtle_solver

Board Regular
Joined
Mar 31, 2006
Messages
71
Hi All -

I am working on a hopefully simple macro, but would like some help to get started.

Summary of what I would like the macro to do below:

Original Sheet Contains:
- List in columns A through W (Size may change)
- Number of rows in list changes daily.

1. Seach Column D for specific words within the cells. (ex. Candy Or Nachos)
- Note: Rows in Column D may include text such as "Candy - Chocolate". This is would return true because it match Candy.

2. Delete all Rows that don't match the criteria.

3. Then create a new Sheet named "Candy" with only the rows that matched the Candy Criteria and a new sheet named "Nachos" with the rows that matched the Nachos Criteria.



Note: I would need Row 1 (Column Headers) to be copied in the Candy & Nachos sheet.

The final result would be as follows:

Summary Sheet (Original sheet)
- Contains all the rows that matched the criteria in Column D.

Candy Sheet
- Only the rows that matched "Candy" in Column D

Nachos Sheet
- Only the rows that matched "Nachos" in Column D

I would appreciate any help.

Manny
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

Forum statistics

Threads
1,224,582
Messages
6,179,670
Members
452,936
Latest member
anamikabhargaw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top