Automating Processes - Filter & Delete Rows

RichCowell

Board Regular
Joined
Dec 5, 2013
Messages
124
Office Version
  1. 365
Platform
  1. Windows
Hi all,
I regularly download CSVs of delegate info for events.
However, they include a lot more rows than I need.
To get around that I usually convert it to a table as I often need that later, then hide the rows containing "Attending" in "Column1", then delete the remaining rows, then show the Attending again.

Can anyone suggest a way of automating this to save me faffing around repeating it every time?


e.g.
ForenameSurnameEmailWorkplaceColumn1Column2
1JoeBloggsjoe.bloggs@bloggs.comBloggs incNo ResponseNone
2CharlesWindsorhrh@royal.co.ukThe PalaceAttendingNone
3SidJamessid@carryon.ukRank OrganisationNot AttendingNone
4TaylorSwifttswift@taylorswift.comNANot AttendingNone
5WinstonChurchillwinston@churchill.co.ukUK GovAttendingNone

So I need to delete all the rows with "No Response" or "Not Attending" in the Column1 column, leaving only the rows with "Attending"

This is done on multiple CSVs so I'd like to avoid creating a template to copy and paste the data into if possible.

Thanks!
Rick
 
Is this a range or a table when you are going to run the Autofilter? if it is a table what is the Tables name?
 
Upvote 0
It is just a column in a table; I don't name it, so it is just Table1, and the 8th column in the table.
 
Upvote 0
Try...
VBA Code:
    With ActiveSheet.ListObjects("Table1").DataBodyRange
        .AutoFilter 8, "<>Attending", xlAnd
        .EntireRow.Delete
        .AutoFilter
    End With
 
Upvote 0

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