Skip to content

Delete Filtered Records in an Excel Database with a Recorded Macro

    Here’s our scenario: we import product data into Excel every month but we need to delete the discontinued items.  

    To make this process quicker we are going to record a macro.  

    The trick to getting this to work is to use Go To Special… Visible cells only

    So the steps are: (also shown in the video below).

    1. Start recording
    2. Select cell A1 (top left cell of your database)
    3. Add filters Data (tab) Filter
    4. Select cell A2 and use CTRL SHIFT END to select to the last cell in the data region. This step is necessary before selecting visible cells as you don’t want to select them across the whole worksheet – just within your database.  You also don’t want to delete your column headings.  
    5. Apply your specific filter
    6. Click Find & Select | Go To Special…
    7. Select Visible cells only
    8. OK
    9. Delete selected rows Home (tab) Delete | Delete Sheet Rows
    10. Remove filter and complete any other steps you want to include in your macro
    11. Stop recording.

    Leave a Reply