This VBA script hides rows for email addresses not included in your specified domain list.
-
Open the Excel File: Open the Excel file in which you need to filter the data.
-
Create a New Worksheet:
- Add a new sheet named Domains.
- List all the email domains you want to filter by in column A. The script can also handle the domains in single quotes or with @ in front of them. So for instance, they can be listed as:
breakfastmail.com
'magicmail.net'
@example.com
-
Add the VBA Code (copy the code from script.bas):
-
Open the VBA editor (Alt + F11).
-
Insert a new module (Insert > Module).
-
Copy and paste the provided VBA code into the module.
-
Side note: make sure that the script matches your report:
-
-
Run the Macro:
- Close the VBA editor.
- Press Alt + F8, select FilterByDomain, and click Run.