Filter and delete from 5 worksheets

thedeadzeds

Active Member
Joined
Aug 16, 2011
Messages
451
Office Version
  1. 365
Platform
  1. Windows
Guys,


I have 5 worksheets all with tables of data. The worksheets and table names are as follows:


worksheet name = BA1 and the table name is tab1
worksheet name = BA2 and the table name is tab2
worksheet name = BA3 and the table name is tab3
worksheet name = BA4 and the table name is tab4
worksheet name = BA5 and the table name is tab5


Is there a way to filter by column D for all worksheets and delete all rows unless column 4 shows 'New Calls'. So filter all worksheets above based on column D and delete all data unless column D shows 'New Calls'. So essentially the only data showing in all 5 tables should be 'New Calls'.


Hope this makes sense
Thanks
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Try turning on the Macro Recorder, and record yourself manually setting it up for one sheet.
That should give you bulk of the code you need to actually do what you want for each page.
Then, you can wrap it in a loop that loops through each worksheet, like this:
Code:
Dim ws as Worksheet
Application.ScreenUpdating = False
For Each ws in Worksheets
    ws.Activate
[I]    'your code here[/I]
Next ws
Application.ScreenUpdating = True

If you need any help cleaning things up, post your code here, and let us know what needs fixing.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,152
Members
453,021
Latest member
Justyna P

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