VBA Hide rows based on two values on another sheet

Ellias_Adelle

New Member
Joined
Sep 13, 2021
Messages
7
Office Version
  1. 365
Platform
  1. Windows
Hello,

I have a report that produces a spreadsheet where column B has last names and column C has first names. There are many tabs like this and that number of tabs may vary.
On a new tab named "Name Filter" I have set up Column A for Last names and a Column B for First names.

What I want to do is create a macro that views each row of the active spreadsheet and checks if the first name and last name are the same as any of the names on the "Name Filter" sheet. If they are not a match I would like to hid that row.

I've tried a number or different things, even trying to settle to just reference the last name, but I'm still having issues. Does anyone have some advice?
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

Forum statistics

Threads
1,223,893
Messages
6,175,244
Members
452,622
Latest member
Laura_PinksBTHFT

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